This is really something you should Google..
Anyway, open up your favorite text editor, write the code, save the file (let's assume you name it
myprogram.c), then run..
Code:
gcc -omyprogram myprogram.c
..to compile it, and..
to run it.
Consult gcc man pages for more compile options. Or some tutorial.
You could also use some IDE.