C++ Overview
Amit Waghmare
June 30, 2019
C language is a general-purpose programming language. It is
similar to c language but, the syntax of c and c++ is a little bit different. In C
we use printf for display statements
and scanf for accepting the input from the user but, in C++ We use
cout<< for the printing statements and cin>> for accepting input
from the users. So first we see the simple program of C to print Hello World.
A simple program in C++
#include<iostream.h> //standard I/O Streams
#include<conio.h> //MSN-DOS compiler
void main() //execution is started from this line
{ //starting of program body
cout<<"HELLO WORLD";//to print the text on O/P screen
getch(); //it holds the O/P screen
} //ending of program body
------------------------------------------------------------------------------------------
And save with extension .cpp
for eg.
simple.cpp//simple is the name of the file and .cpp is an extension of the file.
// Is one type of comment e.g.
void main();//Execution is started from this line.There are other functions available in c but, I will teach you in the next blog.......
C++ Overview
Reviewed by Amit Waghmare
on
June 30, 2019
Rating: