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

What is wrong with this statement? std::auto_ptr ptr(new char[10]);

0 Answers   Amazon,


In C++ what is the meaning of data hiding?

0 Answers   Aricent,


Write a program that can take input from 3 to 8 and calculate the average?

0 Answers   Accenture,


Can we call a virtual function from a constructor?

1 Answers  


Name the operators that cannot be overloaded.

1 Answers   Wipro,






What is the difference between malloc, calloc and realloc?

0 Answers   Alter,


What does it mean to take the address of a reference?

0 Answers   Amazon,


Implement a 2D bit-matrix representing monochrome pixels which will have only OFF/ON values and will take on an average only one bit of memory for each stored bit. How to perform various operations on it?

0 Answers   Adobe,


In C++ what is a vtable and how does it work?

0 Answers   Agilent,


C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.

0 Answers  


What is static variable and difference between(const char *p,char const *p,const char* const p).

0 Answers   Accenture,


CDPATH shell variable is in(c-shell)

0 Answers   Siemens,


Categories