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 the difference between member functions and static member functions?
Explain the FOR loop with a help of a code.
dynamic scoping is
What is a memory leak in C++?
Write a program to read two numbers from the keyboard and display the larger value on the screen
Question on Copy constructor.
Explain the difference between method overriding and method overloading in C++?
Explain why C++ is not purely Object Oriented Language
Write a C++ Program to Reverse a Number using while loop.
what do you mean by exception handling in C++?
C++ Public access specifier instead of Private – What is bad ?
Identify the error in the following program. #include<iostream.h> void main() { int i = 0; i = i + 1; cout « i « " "; /*comment *//i = i + 1; cout << i; }