Starting C++ Tutorials-- Installing compiler and writing our first program

in #tutorial5 years ago

Hello Everyone

I hope you guys are doing well. I am going to start a series of tutorial of C++. In this tutorial we will learn about the basic C++. If you follow this tutorial you will able to writer several codes just like a simple calculator and much more. If you are a computer student and you already know the basic of c++ then this tutorial is not for you but you can still ready this just for revision purpose.

In this post we will learn how to download c++ compiler and start writing codes. So for this tutorial i am going using DevC++ becasue this compiler is much simple and provide very good environment to a newbie.

Step 1

First of all type Devc++ in google and click the first link.

Capture.JPG

After clicking on the link click the download button as show in the picture below and download the Devc++ compiler as i already have that compiler so let skip to the compiler

Capture2.JPG

After installing the compiler open it and you will see a white blank page press control+n to start a new page.

Capture3.JPG

In the picture below you can see

Capture4.JPG

the basic syntax of a very basic program. We write our code in the main function. So lets write a simple program that print "Hello World" and "This our first c++ program.

Capture5.JPG

We wrote a simple program as you can see in the above picture. The source code of that program is

#include<iostream> using namespace std; int main() { cout<<"Hello world"<<endl; cout<<"This is our first C++ program "; return 0; }

Ok so our code is done now lets compile it and run it to see if our code is working or not.

Capture6.JPG

And Bingo our code is working very well. As you see the program is printing Hello world and This is our first c++ program as per we decided.

so for now this much is enough we will stat discuss every single thing we wrote there just like what is cout and iostream and endl ...etc. In the upcoming post i will explain everything and we will write another program and will use other things like variable function and much more. But before that i want you to write that code in your own compiler and practice till our next post.

Good Bye for now Take care and stay Happy.

Sort:  

Congratulations @pakgamer! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You published your First Post
You got a First Vote

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Rather get people to use VIM or EMACS. Sure it will be a bit confusing but will be totally worth it.