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 |
Mention the default functions in C++, how would you detect that error has occurred inside the constructor and destructor.
Explain what happens when an exception is thrown in C++.
What is a class in C++?
0 Answers Amazon, TCS, UGC Corporation,
What is pass by value & reference.
How to generate random numbers in C++ with a range?
What is bool in C++
How does free know the size of memory to be deleted
Identify the errors in the following program. #include <iostream> using namespace std; void main() { int i=5; while(i) { switch(i) { default: case 4: case 5: break; case 1: continue; case 2: case 3: break; } i-; } }
What are the costs and benefits of using exceptions?
Consider the following C++ program
What's the value of the expression 5["abxdef"]?
Write a C++ program to print strings in reverse order.