This tutorial is for those people who know how to program but doesn’t know how to run the C program in Linux. The linux itself is written in C programming which means it is very friendly to programmers. My teacher once said If you want to be a good in programming use Linux. Now, I am going to show you how to compile and run C programming in Linux through Terminal which is going to be very basic. This is the source code of a very simple program which I am going to compile and run:
First, save your C programs as file_name.c. Your file name can be any but the extension has to be .c. After that, open the terminal and type:
If your program don’t have any errors, it will successfully compiled.
After you successfully, compiled the program, you can see a file_name.out in the place where you save your program.
To run the program, type:
A simple program “hello world” is executed.