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:00
What is a distinguishing feature of today’s graphic application software?) graphic applications are used today on a variety of devices, including touch-screen kiosks and mobile phones.
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
question
Computers and Technology, 23.06.2019 13:00
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
question
Computers and Technology, 25.06.2019 00:30
You are to write a series of steps that anyone could follow to solve the following three problems: 1. even odd a. assume that someone tells you a number (an integer number) b. you hear the number and respond with the word even or odd 2. average a. assume that someone tells you between 3 and 5 numeric values. b. you hear the numbers and respond with the average is some number 3. dog or cat a. explain to a child the differences between a dog and a cat. b. your explanation could be used by a child or anyone to distinguish the difference between a dog and a cat
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
English, 02.04.2020 01:59
question
Mathematics, 02.04.2020 01:59