In the below video I have mentioned that how you can write, run and compile C/C++ program using Code::Blocks IDE.
Just visit below link to download Code::Blocks for free.
http://thecrazyprogrammer.com/2013/06/gcc-compiler-download-codeblocks-1211.html
Also Read: Download Turbo C++ for Windows 8 for Free
Also Read: How to Write and Run C/C++ Programs in Ubuntu (Linux)
how to run in mac c and c
++ programs
You can use codeblocks, it is also available for mac. Download it from below link:
http://www.codeblocks.org/downloads/26