Addition of two variables when user gives the value in C++ programming
Sum of variables when user gives input:
Program:
#include < iostream >
using namespace std;
int main()
{
int a , b;
cin >> a;
cin >> b;
cout << "sum = " << a + b << endl;
return 0;
}
Or
#include < iostream >
using namespace std;
int main()
{
int a , b;
cin >> a >> b;
cout << "sum = " << a + b << endl;
return 0;
}
Comments
Post a Comment