Write
Open a text editor and type the above mentioned "Hello World" code.
Save this file as HelloWorld.c.
Compile
Open command prompt and go to your current working directory where you saved your HelloWorld.c file.
Compile your code by typing gcc HelloWorld.c in command prompt. Your program will compile successfully, If your program doesn't contain any syntax error.
It will generate an a.out file.
Execute
Now run your program by typing a.out in command prompt.
Output
You will see "Hello World" printed on your console.
Source : Writing first C program, Hello world Program
./test
? – muru Mar 22 '15 at 13:09