Write C++ program to calculate sum of two numbers
#include
using namespace std;
int main()
{
int sum,a,b;
cout<<"Enter value of a:"<<endl; cin>>a;
cout<<"Enter value of b:"<<endl; cin>>b;
cout<<"The sum of a and b is "<<(a+b);
return 0;
}
The Way to Programming
The Way to Programming
Write C++ program to calculate sum of two numbers
#include
using namespace std;
int main()
{
int sum,a,b;
cout<<"Enter value of a:"<<endl; cin>>a;
cout<<"Enter value of b:"<<endl; cin>>b;
cout<<"The sum of a and b is "<<(a+b);
return 0;
}
Sign in to your account