Answer to Question #156267 in C++ for irtaza

Question #156267

Write a program that asks the user to enter two numbers, obtains the two numbers from the user and prints the sum, product, difference, and quotient of the two numbers.


1
Expert's answer
2021-01-17T08:07:37-0500
#include <iostream>
using namespace std;
int main () {
    int number1, number2;
    cout << "Enter the first number: ";
    cin >> number1;
    cout << "Enter the second number: ";
    cin >> number2;
    cout << "The sum of two numbers: " << number1 << " + " << number2 << " = " << number1 + number2 << endl;
    cout << "The product of two numbers: " << number1 << " * " << number2 << " = " << number1 * number2 << endl;
    cout << "The difference of two numbers: " << number1 << " - " << number2 << " = " << number1 - number2 << endl;
    cout << "The quotient  of two numbers: " << number1 << " / " << number2 << " = " << number1 / number2 << endl;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog