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 a memory leak in C++?
Do you know about Agilent PRECOMPILERS. ?
Write a program that ask for user input from 5 to 9 then calculate the average
Identify the error in the following program. include<iostream> using namespace std; void main() { int num[]={1,2,3,4,5,6}; num[1]==[1]num ? cout<<"Success" : cout<<"Error"; }
What is a virtual base class?
Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.
What is Advantage and Use of THIS pointer in C++ – Scenarios?
What are the different scope C++ provide ?
Without using third variable write a code to swap two numbers.
What are the advantages and disadvantages of B-star trees over Binary trees?
How can you force the compiler to not generate them?
Can we use THIS Pointer in static function – Reason in C++?