+2 votes
in Programming Languages by (20.3k points)
When I compile my C code using gcc, it creates a.out as executable. How can I create excutable file with different name?

1 Answer

0 votes
by (48.7k points)

You need to specify the executable file name using "-o" option. See the below example.

gcc recur.c -o recur.out

It will generate executable file recur.out and then you can run it by typing: