Thursday, 3 October 2013

Programme to add 2 numbers..

#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c;
cout<<"Enter 2 numbers ";
cin>>a>>b;
c=a+b;
cout<<"the sum is "<<c;
getch();
}
cout is a command to get output on screen
cin is a command to get input from user
getch(); and clrscr(); is included in header files conio.h
#include is used for including header files
void main is the main function
int is to declare integers
c=a+b; is to add a and b

No comments:

Post a Comment