For Codeblock, please first download MinGW, then download and install Code::Block Ide.
You can learn more on install in here.
Or you can directly download the compact package - 76MB.
#1. Save the source file as a c extension
#2. Give the command: lcc somefile.c
#3. Give the command lcclnk somefile.obj
#4. Run your program somefile.exe