Wednesday, 6 July 2016

Beginning with c++: first c++ program

Gameplay

All of us knows cpp is object oriented programming language and it was developed by bjarne stroustrup.

Let us begin with a simple example of cpp program that prints a string on the screen.

program :

   #include<iostream.h>// include header file

    Void main()  // main function
   {
 
cout<<"welcome to c++ ";// statement

} // end of program.

note here // symbol is comment symbol.

Every cpp program start with header file. ( here iostream. h is header file. )

 The execution of the program begins at main () . Hence every cpp program must have a main function.

Every cpp statement end with semicolon

No comments:

Post a Comment