Thursday 28 July 2016

write a program in c++ to addition of two number

Here we learn to write a program in c++ to addition of two number.Suppose we have a two number like a,b and sum of  a,b will be result on outputSo we coding like that


#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int a,b,sum;
cout<<"\n enter the value of a";
cin>>a;
cout<<"\n enter the value of b";
cin>>b;
sum=a+b;
cout<<sum;
getch();
}



The Output will be like this

Enter the value of a: 40
Enter the value of b: 24
sum=64



No comments:

Post a Comment