Print the sum of two numbers:
-----------------------------------
The sum of 29 and 30 is: 59
#include<iostream>
using namespace std;
int main()
{
int sum,a,b;
cout<<"enter your number 1: ";
cin>>a;
cout<<"enter your number 2: ";
cin>>b;
sum=a+b;
cout<<"--------------------"<<endl;
cout<<"The sum of "<< a<<" and "<< b<<" is: "<< sum;
}
Output:
Tags
c++