
How to write, compile and run the C++ program.
Example 1: Write a C++ Program, to print 'Welcome to C++ Programming'.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
cout<<"Welcome to C++ Programming.";
getch();
}
Example 2: Input two numbers and find sum.
#include<iostream.h>
#include<conio.h>
void main()
{
int a, b, c;
clrscr();
cout<<"Enter 1st Number: ";
cin>>a;
cout<<"Enter 2nd Number: ";
cin>>b;
c=a+b;
cout<<"Sum = "<<c;
getch();
}
Ad: