Write a C++ Program to find Addition of Two Numbers.
Solution:
/* C++ Program to find Addition of Two Numbers */
#include<iostream>
using namespace std;
int main()
{
int x,y,sum;
cout<<"Enter first number :: ";
cin>>x;
cout<<"
Enter second number :: ";
cin>>y;
sum=x+y;
cout<<"
Sum of two numbers [ "<<x<<" + "<<y<<" ] = "<<sum<<"
";
return 0;
}
Output:
/* C++ Program to find Addition of Two Numbers */
Enter first number :: 12
Enter second number :: 34
Sum of two numbers [ 12 + 34 ] = 46
Process returned 0
| Is This Answer Correct ? | 0 Yes | 0 No |
If class D is derived from a base class B
What does it mean to declare a member function as static in C++?
What is the difference between an ARRAY and a LIST in C++?
What Is A Conversion Constructor C++ ?
Explain the difference between C and C++.
What's the value of the expression 5["abxdef"]?
Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.
How to run C++ program in cmd
What is Copy Constructor?
Explain why C++ is not purely Object Oriented Language
In C++ what do you mean by Inheritance?
what is a pragma in C++?