Friday, 27 February 2015

c++ program to find sum of two numbers

c++ program to find sum of two numbers

here is the program which will take two numbers from the user and will give out its output to the user as its sum.


 


so follow the following code for turbo c++ to find the sum of two numbers 


#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c;
cout<<"enter a no";
cin>>a;
cout<<"enter another number";
cin>>b;
c=a+b;
cout<<"the sum is"<<c;
getch();
}


for dev c++,use the following code


#include<iostream.h>
#include<conio.h>
int main()
{
int a,b,c;
cout<<"enter a no";
cin>>a;
cout<<"enter another number";
cin>>b;
c=a+b;
cout<<"the sum is"<<c;
getch();
return 0;
}
Previous Post
Next Post

0 comments: