Write a C++ Program to find Addition of Two Numbers.



Write a C++ Program to find Addition of Two Numbers...

Answer / 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

More C++ Interview Questions

Mention the default functions in C++, how would you detect that error has occurred inside the constructor and destructor.

0 Answers   Adobe,


Explain what happens when an exception is thrown in C++.

0 Answers   Amazon,


What is a class in C++?

0 Answers   Amazon, TCS, UGC Corporation,


What is pass by value & reference.

0 Answers   Accenture,


How to generate random numbers in C++ with a range?

0 Answers  






What is bool in C++

0 Answers  


How does free know the size of memory to be deleted

0 Answers  


Identify the errors in the following program. #include <iostream> using namespace std; void main() { int i=5; while(i) { switch(i) { default: case 4: case 5: break; case 1: continue; case 2: case 3: break; } i-; } }

1 Answers  


What are the costs and benefits of using exceptions?

0 Answers   Amazon,


Consider the following C++ program

0 Answers  


What's the value of the expression 5["abxdef"]?

0 Answers  


Write a C++ program to print strings in reverse order.

0 Answers   Amdocs,


Categories