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 Differences Between A C++ Struct And C++ Class?
Explain the importance of method overloading in C++?
0 Answers Akamai Technologies, Infogain,
How can you force the compiler to not generate them?
What is an abstract class?
Write a C++ Program to find Addition of Two Numbers.
What does it mean to declare a function or variable as static?
How does stack look in function calls? Write a recursive function call, how will the stack look like?
what is friend function in C++?
What is RTTI and why do you need it?
Describe the different styles of function prototypes in C++.
Tell me about virtual function
How to reverse a string in C++