1. Click on this link: http://www.codeblocks.org/
2. Then click on downloads tab mentioned on the website.
3. Then click on “download the binary release”.
4. Then you’ll select a suitable package depending on your platform. If you are a windows user, simply click on codeblocks-17.12mingw-setup.exe and run this exe file and follow the instructions as it is given. This setup will also download the GNU gcc compiler.
5. Finally, open the codeblocks IDE, you may have to specify the compiler and debugger path
Go to settings -> compiler -> In "Selected Compiler", choose "GNU GCC Compiler" -> Select tab "Toolchain Executables" -> Check the "Compiler's Installation Directory" -> set it to "c:\Program Files\codeblocks\MinGW" if not already set.
6. You are all set.