First program in CPP.Cpp is an Object oriented language (OOpl). It was developed in 1980 at BELL Laboratories..
First program in C++
Cpp is an Object oriented language (OOpl). It was developed in 1980 at BELL Laboratories. It is improved version of C language. It provides the facility of working with objects and classes. It is very powerful language and is used to develop a variety of program.
Here is the First program with screen shot in Borland C++ . You can use any Software like Visual Studeo, codeBlock etc and whatever you like. The main purpose is practice to get success. Rbatec provide you a platform to learn Cpp.
C++ is close to human langauges that’s why this is called High Level Language.
Cout<<”welcome to c++”<<endl;
Getch ( );
|First Program in Cpp|
Preprocessor Directive (#)
Instruction given to Compiler before the execution of actual program. The preprocessor Directive start with hash symbol #.
Include preprocessor directive include header file in cpp program.
It is the collection of library function to perform different tasks.
Syntax of Header file
“Iostream” is stands for input output stream.
The main function () is the initial line of CPP Program. When the program is run, the control enters main() function and start executing its statements.
Syntax of Main Function
Body of main dunction.
Body of program
In the above first cpp program the body is (cout<<”welcome to c plus plus”;).
In Double quotes the Line is displayed on screen. You can display any this on screen like your name .
Cout<<”I m visiting RBatec blog”; etc
In above c++ first program
The first line is preprocessor Directive to include a header File iostream.h.
The secong line in main function where the execution of program starts.
Main function should always return 0.its mean Main fuction () ran fine.
You can run this program in Borlan Cpp by using short Command ctrl+f9.
Reference Book: Object Oriented Programming Using C++