0% found this document useful (0 votes)
3 views7 pages

Codeblocks IDE

This document provides a step-by-step guide on how to create, compile, and run a C program using the CodeBlocks IDE. It includes instructions for creating a new file, setting up a C workspace, writing a simple 'Hello, Codeforwin!' program, and compiling it using the Build menu or shortcut key F9. Error handling is also mentioned for cases where the program contains errors during compilation.

Uploaded by

amaanmuslimeen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Codeblocks IDE

This document provides a step-by-step guide on how to create, compile, and run a C program using the CodeBlocks IDE. It includes instructions for creating a new file, setting up a C workspace, writing a simple 'Hello, Codeforwin!' program, and compiling it using the Build menu or shortcut key F9. Error handling is also mentioned for cases where the program contains errors during compilation.

Uploaded by

amaanmuslimeen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

How to create C program in CodeBlocks IDE

Open CodeBlocks IDE and create a new file. Click on File → New → File.
From the New form template window select C/C++ source and click Go button.
If you see a welcome message, click next to skip the welcome message. Make sure you have checked Skip
this next time checkbox if you do not want to see this welcome message again.
Next, select your language from C/C++ source window and click Next button.
Give name to your file and specify the location.
It is always recommended to save all your C programs in a C workspace (directory). Creating a C workspace is
onetime process. For now, create a new C workspace (folder) with name “Codeforwin C tutorials” anywhere in
your computer.
Once you created a C workspace, click the ellipsis button present under File name with full path. Browse your C
workspace, mention the file name click Finish.
Write and save your first C program. Press Ctrl + S to save.
For now you can simply copy paste the hello world C program.
#include <stdio.h>

int main()
{
printf("Hello, Codeforwin!");

return 0;
}
How to compile and run C program in CodeBlocks
Once you created your first C program it’s time to compile and run the program.
To compile and run a C program, click Build → Build and run to compile and build your C program,
alternatively use the shortcut key F9.
In case, your program contains any errors. Error messages are shown in the Build messages tab below the code editor.

You might also like