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

When would you choose to return an error code rather than throw an exception?

0 Answers   Amazon,


What is partial specialization or template specialization?

0 Answers   Amazon,


What do you know about Volatile keyword in C++? Explain with an example code.

0 Answers   Adobe,


What is a COPY CONSTRUCTOR and when is it called?

0 Answers   IBS,


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

0 Answers   Amdocs,


Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.

1 Answers  


How does stack look in function calls? Write a recursive function call, how will the stack look like?

0 Answers   Adobe,


Write a C++ Program to Find whether given Number is Odd or Even.

1 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 fundamental features of an object-oriented language?

0 Answers   Accenture,


What are "pure virtual" functions?

0 Answers   Adobe, Alter, iNautix,


There is a base class sub, with a member function fnsub(). There are two classes super1 and super2 which are sub classes of the base class sub.if and pointer object is created of the class sub which points to any of the two classes super1 and super2, if fnsub() is called which one will be inoked?

0 Answers   Alter,


Categories