 Welcome to the course on computer programming. In this session, we will see how to write a basic C++ program and a simple CPP program using code blocks ID on Windows. So, let us begin by writing a basic C++ program to add two numbers. We will click on start, all programs, search code blocks over here, click code blocks, code blocks simple CPP. Code blocks ID will appear here, which has just appeared. Now, we will create a project and click on file new project. Select simple CPP project in this window and click on go. You can check this button, skip this page next time so that it does not appear next time and click next. Graphics only is selected by default. You can ignore this and click next. Over here, we need to enter a project title. For example, we have to create a project for add two numbers. So, we will write add two numbers as a project title. We will create it on desktop. We will make a new folder called C++ underscore programs on desktop. We will keep it in this folder. As you can see, the path is desktop C++ programs. If you notice the project file name, which was blank earlier, has appeared here as add two numbers dot CBP, CBP is code blocks project. Click next. GNU GCC compiler is selected. Click on finish. We have now created a project. Now, we need to add a file. For this, we will click on file new file. Click CC++ source and click on go. Click this check button and click next. C++ is selected by default. So, let us click on next. We will enter the file name, say add two numbers dot CPP, which is the C++ extension. We need to keep it in our project directory. C++ underscore programs add two numbers is a project directory. We will save it over here in this folder. Click on debug and release. This is important for debugging our project and click finish. Now, double click on add two numbers, double click on sources and double click on add two numbers dot CPP. This is the left pane, which is the workspace window. Over here, we need to write a program. We will start writing by hash include IO stream using namespace std int main return 0. This is our template program. We will write int num1, num2. We will ask the users to enter two numbers, cout enter two integer numbers, n del is nothing but newline character. We will accept two numbers from the user using the cn statement num1 and num2, semicolon. We will now print the addition of two numbers is and we will compute the addition over here itself num1 plus num2 semicolon, sorry, n del semicolon. This completes our add two numbers program. Now, we can either build using the build and run option available here or you can also click on build, build and run. What we expect is a terminal, which has just appeared. It asks us to enter two integer numbers, which was printed using the cout statement. We will enter two numbers say 45 and 34, we will press enter. Addition of two numbers is, which was displayed here, has appeared over here in the terminal and num1 plus num2, which is equal to 79, has appeared over here. This is how we write a basic C++ program using code block citing. Press enter to exit the terminal. Let us now see how to write simple CPP programs. So, we will create another project file, new project, simple CPP project and click on go. Graphics only, which is selected by default, click next. Project title. Say we want to draw three polygons. So, we can say draw polygons as a project title. It will be displayed over here in this directory. The code blocks project dot cpp is created over here and we will click on next. GNU GCC compiler is selected. Click finish. As you can see, there is no much difference in creating simple CPP and basic programs. Now, we will add the file. We will select draw polygons project. We will click on file, new file. Select C++ source and click on go. C++ is selected here. So, we will click next. We will now write draw polygons dot cpp. We will browse in which directory it has to be created, we will click save, we will click on debug and release which is most important, we will click finish. As you can see, the draw polygons dot cpp has appeared over here. We already have a program written. We will just copy paste this in code blocks id. We will save it, control s and we will build and run it. As you can see, the three polygons have been drawn over here. This is one way of writing a program. Another way is to create a source code file and not the project. Please note that simple CPP code should not be created using this way. For simple CPP, you need to create a project itself which we have just done. So, let us now close both the projects as it will interfere with our new program. We will close the add to numbers project, right click close project. Yes, we will save the changes, right click close project and we will save the changes. Now, we will write a simple program hello world, file new c++ source go, select c++ click next. File name with the full path, we will browse to the directory first, we will go to the directory called c++ programs which is present on add a store, we will give the title hello world dot cpp and we will click save. Please note, there is no debug or release available here for a file and we will click finish. Hello world dot cpp has just opened. Now, we can write a simple program hash include IO stream using namespace std int min c out hello world end in and return 0. We will save it and we will build and run it. As you can see, hello world has been displayed on the terminal, press enter to continue. Now, let us examine the folder in which we have created both our projects. If you recollect, we had created our project on desktop c++ programs directory. So, let us go into the directory. We will minimize code blocks. This is our desktop c++ programs, double click connect. If you see, we had created two projects add to numbers and draw polygons. Hello world dot cpp was a file which was created. As you can see, hello world dot exe and hello world dot o is already present here because we built and run our program. We will learn about dot exe and dot o when we examine the add to numbers folder. Let us go into this folder add to numbers dot cpp. This is the code blocks project file add to numbers dot cpp is our source code that is our main file where we actually added two numbers and printed it. This is a layout file. The layout file contains the settings of the workspace of a project which files were opened and where they were positioned etc. The two folders bin and object where bin contains the executable of a project which is a dot exe file whereas the object contains the object file. Object file is nothing but the file that contains translatable machine code. In this session, we have seen how to write simple cpp programs, basic programs and have examined what files does code blocks project creates. Thank you.