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 |
What are the advantages/disadvantages of using inline and const?
What is the difference between an ARRAY and a LIST in C++?
How can a C function be called in a C++ program?
Explain the importance of method overloading in C++?
0 Answers Akamai Technologies, Infogain,
What is Advantage and Use of THIS pointer in C++ – Scenarios?
What's the value of the expression 5["abxdef"]?
What are the advantages and disadvantages of B-star trees over Binary trees?
Find the Factorial of a number using a program.
What is conversion constructor in C++
How to delete array of objects in C++? Proof by C++ code for proper deletion
What is data abstraction? How is it implemented in C++?
C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.