Sum of two number in C++ by R4R Team

Example-
First number n1=10
Second number n2=20
sum is 30


program-

#include
using namespace std;
int main()
{
int a, b, c;
cout << "Enter two numbersn";
cin >> a >> b;
c = a + b;
cout <<"Sum is: " << c;
}


output-

Enter two numbers
3 5
Sum is: 8

-In this program, we store two number in variable 'a' and 'b' then add a and b and store in variable 'c'. then display using cout.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!