Wednesday, 27 December 2017

Basics of C++ language

Click Here!

                               Basics of C++


Guys today I am sharing some basics of C++ language . I am not a great programmer or a language expert ,I am also a learner so, if you see something wrong plz comment and tell me and if you like my tutorial plz like and comment.

I know every student want first class to be good so I directly start with programming and will tell you every details of code that I have written.
So let's get started



Look at the programme above first you are looking a line

// My first C++ program 

This line is known as comment this line is not executed by compiler that is just for understanding  about the program. Every line starting with // is known as comment and is not executable.

Second line
 #include<iostream.h>
It is known as header file it means we are saying computer to include the file that facilitates the input and output stream or to facilitate the "cout" and "cin" .
Similar we include other header files like
Conio.h,stdio.h. conio.h is used  for facilitate the getch () function and stdio.h is for clrscr (); .

Now third line
Void main ( )
That is where computer start execution  in curly braces { } we have main part of program. This line indicate beginning of main function.

Cout<<"welcome to C++ programming";

Anything we write in inverted commas "   " print exactly same on screen. cout should be always written in small letters.
We can understand  cout by shows out we write that command in cout that we want exactly to print on output screen.

getch ();

It is used to hold black screen of output . If we don't put this the output screen will disappear very quickly even we can't see our output . This is for general understanding basically getch () basically mean getting a character as soon as you press any character from your keyboard black screen will disappear till then you can see your output.

Every program should start with curly braces after main and end with curly braces at the end and every executable line that is in main function should end with semicolon  ;  like in cout line you see.

Clrscr ( );

It is used to clear output screen. If anything is written on output screen before your program it clears it.

Output of above coding is




Guys it's over for today meet in next post

Please like and share.

Thanks for giving your  important time .

No comments:

Post a Comment

Metro Rail Corporation vacancy salary 37,500 apply now

Metro rail corporation Vacancy Metro rail corporation has published notification for 3 posts 1.Senior section engineer      08 posts 2....