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 is wrong with this statement? std::auto_ptr ptr(new char[10]);
In C++ what is the meaning of data hiding?
Write a program that can take input from 3 to 8 and calculate the average?
Can we call a virtual function from a constructor?
Name the operators that cannot be overloaded.
What is the difference between malloc, calloc and realloc?
What does it mean to take the address of a reference?
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?
In C++ what is a vtable and how does it work?
C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.
What is static variable and difference between(const char *p,char const *p,const char* const p).
CDPATH shell variable is in(c-shell)