Write a program that accepts 2 integer values from the user, wi For testing purp
ID: 3743197 • Letter: W
Question
Write a program that accepts 2 integer values from the user, wi For testing purposes, you have to output a newline after every user input (see examples below) th the prompts shown. n output the sum, the product, the integef quotient, and the modulus in exactly the same format as the examples below. User input has been bolded and underlined for emphasis. Example 2: Enter the first integer: 15 Enter the first integer: 10 Enter the second integer: 25 Enter the second integer: 5 10 25 35 1 25 258 10 / 25 e 10 % 25-10 15 +5 20 15 5 75 15 / 5 = 3 15 % 5-e Example 3: Enter the first integer: 12 Enter the second integer: 10 12+10 = 22 12 * 1e = 120 12 / 1e-1 12 % le-2Explanation / Answer
#include <iostream>
using namespace std;
int main() {
//Declaring 2 integer variables
int first,second;
//displaying output over screen
cout << "Enter the first integer: ";
//inserting user input to "first" variables
cin>>first;
//Empty line
cout<<" ";
//displaying output over screen
cout << "Enter the second integer: ";
//inserting user input to "second" variables
cin>>second;
//Empty line
cout<<" ";
//Calculations
cout<<first<<" + "<<second<<" = "<<first+second<<endl;
cout<<first<<" * "<<second<<" = "<<first*second<<endl;
cout<<first<<" / "<<second<<" = "<<first/second<<endl;
cout<<first<<" % "<<second<<" = "<<first%second<<endl;
}
Note: Please let me know if you need solution in any other language
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.