subject

How do i set up a remainder for my program? (C++) Details: i’m trying to set up a program meant for a child and i want a division problem to show remainders. I’ve tried but have no idea how.

Program:
#include
#include
#include
Int main() {

const int MIN_NUM = 1,
MAX_NUM = 99;

int randNum1,
randNum2;

Unsigned seed = time(0);
srand(seed);

randNum1 = (rand()%(MAX_NUM - MIN_NUM + 1) + MIN_NUM);

randNum2 = (rand()%(MAX_NUM - MIN_NUM + 1) + MIN_NUM);

case 'D':
case 'd': {
cout << "\nCool! \nLemme set you up with some DIVISION problems! " << endl;

cout << "\n";
cout << "\n";
cout << "\n " << randNum2 << "\n÷ " << randNum4 << "\n \n";

randNumAnswer = randNum2 / randNum4;

cin >> userAnswer;

if (userAnswer != randNumAnswer) {cout << "\nYou didn't get the right answer but try again. Don't lose hope!\n"; }

else if (userAnswer == randNumAnswer) { cout << "\nAmazing!! You did great!\n";}
break;}
}

return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
How are stop motion special effects in animated films created
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
How can the temperature of a room be raised by 5degreesf?
Answers: 1
You know the right answer?
How do i set up a remainder for my program? (C++) Details: i’m trying to set up a program meant for...
Questions
question
Mathematics, 04.03.2021 23:00
question
Mathematics, 04.03.2021 23:00
question
Mathematics, 04.03.2021 23:00
Questions on the website: 13722367