Answer to Question #157775 in C++ for Earl Davis

Question #157775

Divide 100 by 33. Produce the answer AND the remainder as shown in the output below.

 

Both numbers shown above should be stored in variables, BUT the calculations should be done in the output statements. Create variables to store results for this particular exercise. I want you to explore the different ways to do math in this HW. That being said, make sure the two variables with the numbers are referenced in the output.

 

OUTPUT:

100 divided by 33 equals 3, with a remainder of 1


1
Expert's answer
2021-01-23T10:18:58-0500

1-mode)

#include <iostream>
using namespace std;
int main () {
    int divisible = 100, divader = 33;
    cout << divisible << " divaded by " << divader << " equals " << divisible / divader << ", with a remainder of " << divisible % divader;
    return 0;
}


2-mode

 #include <iostream>
using namespace std;
int main () {
    int divisible = 100, divader = 33;  
    int division = 0;
    while (divisible > divader) {
        divisible -= divader;
        division++;
    }
    cout << "100 divaded by 33 equals " << division << ", with a remainder of " << divisible;
    return 0;
}

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
APPROVED BY CLIENTS