How you can run a c program in Linux?

Posted on in Categories , , last updated October 16, 2007

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

How to see output of C program in Linux or UNIX

Posted on in Categories , , , , , , , last updated December 11, 2017

I am a new user of Linux operating system but not to C programming language. At my university we are using Turbo C compiler under DOS/Windows XP to write and compile C programs. Under Linux I wrote a small program called test.c. How do I compile and see the output of C program in a Linux when using Fedora Linux?