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 |
When would you choose to return an error code rather than throw an exception?
What is partial specialization or template specialization?
What do you know about Volatile keyword in C++? Explain with an example code.
What is a COPY CONSTRUCTOR and when is it called?
Write a C++ program to print strings in reverse order.
Write a program to input an integer from the keyboard and display on the screen “WELL DONE” that many times.
How does stack look in function calls? Write a recursive function call, how will the stack look like?
Write a C++ Program to Find whether given Number is Odd or Even.
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 fundamental features of an object-oriented language?
What are "pure virtual" functions?
0 Answers Adobe, Alter, iNautix,
There is a base class sub, with a member function fnsub(). There are two classes super1 and super2 which are sub classes of the base class sub.if and pointer object is created of the class sub which points to any of the two classes super1 and super2, if fnsub() is called which one will be inoked?