How you can run a c program in Linux?
Q. I've a c program and I'd like to run in Linux.
A. C program need to compile and run in Linux using cc or gcc command. When you invoke GCC (GNU C Compiler), it normally does preprocessing, compilation, assembly and linking for you. For example to compile hello.c program , type the following command:
cc -o hello hello.c
OR
gcc -o hello hello.c
It will compile and produced an exectuable file called hello. To run program type:
./hello
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Howto see output of C program in Linux or UNIX
- How to compile program under Linux / UNIX / FreeBSD
- Howto Compiling C program and creating executable file under Linux / UNIX / *BSD
- How do I force IDE CD-ROM drive detecting during the Linux installation?
- How do I run X windows program as normal user?
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: compilation, c_program, gcc_command, gcc_gnu, gnu_c_compiler, Linux



Recent Comments
Today ~ 32 Comments
Yesterday ~ 1 Comment
Yesterday ~ 3 Comments
Yesterday ~ 2 Comments
Yesterday ~ 3 Comments