The code you have written is absolutely fine. Here are few things you might consider:
Make sure you have downloaded the binary release from codeblocks website that had compiler along with it. If you open codeblocks website and select binary release for download you'll see a note. There are actually three links to download and you must select the one which has mingw-setup in it.
i.e., either
codeblocks-13.12mingw-setup.exe
or
codeblocks-13.12mingw-setup-TDM-GCC-481.exe
The Note is as follows:
"NOTE: The codeblocks-13.12mingw-setup.exe file includes the GCC compiler and GDB debugger from TDM-GCC (version 4.7.1, 32 bit). The codeblocks-13.12mingw-setup-TDM-GCC-481.exe file includes the TDM-GCC compiler, version 4.8.1, 32 bit. While v4.7.1 is rock-solid (we use it to compile C::B), v4.8.1 is provided for convenience, there are some known bugs with this version related to the compilation of Code::Blocks itself."
If you are not sure which file you had downloaded, just open codeblocks and go to settings, select compiler. In Global Compiler Settings, go to the tab 'Toolchain Executables' and there below compiler's installation directory textbox, you'll see Auto Detect Button. Click on it. If you get a message that program couldn't detect compiler or something similar, you dont have the compiler.
In that case just go to the website and select the one that has got compiler along with it(see the file format above). Make sure you uninstall the current version and if possible delete its folders.
You can alter your code a bit to stop output window from closing immediately after execution. Here is how:
#include
#include
main()
{
printf("Hello");
getch();
}
If you want to get rid of the processes returned and execution time everytime you run your code, just go to project properties(right click on the project and select properties) . Go to build targets tab and uncheck the checkbox "Pause When Execution Ends" Do this for both Debug and Release(by selecting each of them located in the right side and unchecking the box)
Also make sure you are not adding c files to a single project. As a beginner, create a new project for every code you want to test. Write your code in main.c file that is generated each time you create a new project.
Best,
Aditya