WAP to input two numbers and calculate sum, product and difference
Albiya:
plz anybody can do this
Answers
Answered by
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!
Similar questions
English,
7 months ago
English,
1 year ago
Physics,
1 year ago
Math,
1 year ago
Social Sciences,
1 year ago