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


Please Help Members By Posting Answers For Below Questions

What does floor mean in c++?

834


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!!!)

1861


What is difference between data abstraction and encapsulation?

852


When does a 'this' pointer get created?

851


Define basic type of variable used for a different condition in C++?

890


What is near, far and huge pointers? How many bytes are occupied by them?

903


What is polymorphism and its type in c++?

800


Write a c program for binary addition of two 8 bit numbers.

3898


What is pair in c++?

824


What is virtual base class?

785


Can we specify variable field width in a scanf() format string? If possible how?

917


What is the use of map in c++?

894


Why is polymorphism important in oop?

831


Why cstdlib is used in c++?

808


what are function pointers?

778