Open a text editor and type the above mentioned "Hello World" code.
Save this file as HelloWorld.c.
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.
Now run your program by typing a.out in command prompt.
You will see "Hello World" printed on your console.
Source : Writing first C program, Hello world Program