Answer to Question #296805 in C++ for junior

Question #296805

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


1
Expert's answer
2022-02-12T08:22:17-0500
#include <iostream>
using namespace std;
int main () {
    int num1, num2;
    cout << "Enter the First number: ";
    cin >> num1;
    cout << "Enter the Second number: ";
    cin >> num2;
    cout << "The Sum of two numbers: " << num1 << " + " << num2 << " = " << num1 + num2 << endl;
    cout << "The Product of two numbers: " << num1 << " * " << num2 << " = " << num1 * num2 << endl;
    cout << "The Difference of two numbers: " << num1 << " - " << num2 << " = " << num1 - num2 << endl;
    cout << "The Quotient  of two numbers: " << num1 << " / " << num2 << " = " << num1 / num2 << endl;
    cout << "The Remainder of two numbers is: "<<num1 <<" % " << num2 << " = " << num1 % num2 << 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