Saturday, October 28, 2017

Example of Simple C++ Program


[1] WAP to print message on screen.
                #include<iostream.h>
                #include<conio.h>
                void main()
                {
                        cout<<”This is first program in c++”;
                        cout<<”\n welcome”;
                        getch();
                }
[2] WAP to print value of variables.
                #include<iostream.h>
#include<conio.h>
                void main()
                {
                        int a;
                        a = 50;
cout<< ”\n value of a = ” << a;
getch();          
}

No comments:

Post a Comment