Computer Science, asked by Albiya, 1 year ago

WAP to input two numbers and calculate sum, product and difference


Albiya: plz anybody can do this
Albiya: tomorrow is my exam
siddhartharao77: in which programming language?
Albiya: c++
siddhartharao77: ok
Albiya: can u plz dp it fast

Answers

Answered by siddhartharao77
3

Here is a sample code in C++:

#include <iostream>

using namespace std;

int main()

{

int num1, num2, num3;

cout << "Enter 1st number: ";

cin >> num1;

cout << "Enter 2nd number: ";

cin >> num2;

num3 = num1 + num2;

cout << "\nThe sum of two numbers : " << num3;

num3 = num1 * num2;

cout << "\nThe product of two numbers : " << num3;

num3 = num1 - num2;

cout << "\nThe difference of two numbers : " << num3;

return 0;

}


Output:

Enter 1st number : 10

Enter 2nd number : 5.


The sum of two numbers : 15

The product of two numbers : 50

The difference of two numbers : 5.



Hope this helps!  ------ Good luck!


siddhartharao77: :-)
Albiya: thankz
Albiya: :-) :-) :-) it helps me a lot
siddhartharao77: welcome
Similar questions