once we compile any C code on Linux, we run the code using "./a.out"..
but can we have an executable for every program so that we can run the code directly without compiling the code every time.
just run the executable and get the output!
You could do. Except that normally non-trival C programs are more than one source file.
You could write a C interpretor, but there is no real demand for them. The advantages you get from using C are mainly because it's a compiled language.
I rarely call my programs a.out, it would get far too confusing trying to remember which one did what.
I may be missing the point on your question but C is a compiled language.
To run it you have to:
(a) compile the C source into object files
(b) link the object files with libraries to produce the executable
once you have done that you can run the executable as many times as you like, and you can call it whatever name you like.
It is also compiled specific to the computer's architecture, so you can't expect 386 code to run natively on an UltraSparc. Similarly it is operating system dependent.
I would recommend using "-o" option to specify the name of the executable,
so for example,
(a) if you have a makefile that only completed half of it's tasks, you could continue where you left off without wondering what a.out referred to
(b) if you are creating a shared library, the library often carries and internal representation of it's name, in ELF terms, the SO_NAME field, if the -soname field is not specified it is derived from the output file name, so the shared library may think it's supposed to be "a.out".
(c) in a Makefile, this can be standardised as "-o $@"