Write a program in C++ to print the sum of two numbers using variables.

Print the sum of two numbers:

-----------------------------------

The sum of 29 and 30 is: 59


#include<iostream>

using namespace std;

int main()

{

int a,b,sum;

cout<<"enter your first number: ";

cin>>a;

cout<<"enter your second number: ";

cin>>b;

sum=a+b;

cout<<sum;

return 0;

}


Output:

Write a program in C++ to print the sum of two numbers using variables.

Post a Comment

Please do not enter any spam link in the comment box.

Previous Post Next Post