Write a C++ Program to find Addition of Two Numbers.
Answer Posted / 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 View All Answers
What is doubly linked list in c++?
What are enumerations?
How does atoi function work?
what is a class? Explain with an example.
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
What are the various oops concepts in c++?
What is the difference between public and private data members?
what are the decision making statements in C++? Explain if statement with an example?
Describe private, protected and public – the differences and give examples.
How can I learn c++ easily?
What is a class in oop?
Difference between inline functions and macros?
Is string part of stl?
What is a stl vector?
write a program that will accept a number and print.its equivalent in words the maximum input number is 9999