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 |
How does free know the size of memory to be deleted
Do you know about Agilent PRECOMPILERS. ?
Explain the difference between method overriding and method overloading in C++?
Can we provide one default constructor for our class?
How to invoke a C function using a C++ program?
What is pass by value & reference.
What Is Polymorphism in C++ ?
2 Answers IBS, Impetus, ITC Indian Tobacco Company, Motorola,
Write a C++ Program to Find Sum and Average of three numbers.
what is a pragma in C++?
In C++ what do you mean by Inheritance?
What are the advantages/disadvantages of using #define?
dynamic scoping is