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


Please Help Members By Posting Answers For Below Questions

Are php strings immutable?

787


What is a wchar_t in c++?

816


What are special characters c++?

743


Define anonymous class.

811


How is c++ different from java?

785


What does sksksk mean in text slang?

1835


Can a function take variable length arguments, if yes, how?

769


What are 2 ways of exporting a function from a dll?

872


What is oops and its features?

824


What are issues if we mix new and free in C++?

502


What is the main use of c++?

797


State what is encapsulation and friend function?

940


There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

2758


What is c++ flowchart?

990


Explain why C++ is not purely Object Oriented Language

772