Write a C++ Program to find Addition of Two Numbers.
Answer Posted / hr
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 |
Post New Answer View All Answers
What does floor mean in c++?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
What is difference between data abstraction and encapsulation?
When does a 'this' pointer get created?
Define basic type of variable used for a different condition in C++?
What is near, far and huge pointers? How many bytes are occupied by them?
What is polymorphism and its type in c++?
Write a c program for binary addition of two 8 bit numbers.
What is pair in c++?
What is virtual base class?
Can we specify variable field width in a scanf() format string? If possible how?
What is the use of map in c++?
Why is polymorphism important in oop?
Why cstdlib is used in c++?
what are function pointers?