Write a C++ Program to find Addition of Two Numbers.
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 |
What are the costs and benefits of using exceptions?
Execute the qsort () in c/sort() in c++ library or your own custom sort which will sort any type of data on user defined criteria.
What is static variable and difference between(const char *p,char const *p,const char* const p).
What do you by Function Overloading in C++?
0 Answers Akamai Technologies, Infogain,
How do you work around them?
How will you execute a stack using a priority queue? (Push and pop should be in O (1)).
What is C++11?
Explain function prototypes in C++.
In C++ what is the meaning of data hiding?
Identify the error in the following program. include<iostream> using namespace std; void main() { int num[]={1,2,3,4,5,6}; num[1]==[1]num ? cout<<"Success" : cout<<"Error"; }
Factory Method C++ – How to delete pointers returned by it
What is the 4 difference between delete[] and delete?