Your First Program Using Codeblocks IDE

0001 Your first program

*Using Codeblocks 17.12

1. Create a new Project

2.Select “Console Application” and click on go.

3.Select “C” and click next.

4. Give your project a title and optionally select a folder where you want the project to be created. In this case we use “Upper camel case”` : “0001-MyFirstProgram”

5.Leave all settings as default and choose finish:

6. Open main.c from the tree on the left. [1] Expand sources, [2]then double click on “main.c”.

7. Click on Build, and choose build and run.

8. Your code is now built to an executable file, and the program is executed in the console window:

Exercises

  1. What happens when “Hello world!\n” is changed to “Hello world!” and the program is run?
  2. Modify the printed message to say “Goodbye”.

You can download the project here:

https://drive.google.com/drive/folders/1-oDom6OVimkNZeBACsJs9FZ0byhsNXHv?usp=sharing

The code is shown below:

#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Goodbye world!");
    return 0;
}

© 2021  Vedesh Kungebeharry. All rights reserved. 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s