Have you checked, gcc is installed properly or not. If it is installed properly
Check gcc version using
To compile C program on Linux terminal
1) Write any C program in text editor and save as filename.c
In following example, I have saved this file on my Desktop.
2) To run this program, you have to compile it first.
$ gcc -o compiled-filename /home/user/Desktop/filename.c
Where compiled-filename is the name of compiled file, it can be anything.
This will generate a compile copy of your program as a name compiled-filename in same directory where you ran the above command.
3) Now create output copy of your program.
Following command generate a output file of your program in same directory.
$ gcc /home/user/Desktop/filename.c
4) Now run your program.
where a.out is output copy of your program.
Alternatively you can run compiled copy of your program.