Phillip
Phillip

Reputation: 11

Generate division equation with a whole number result

I have been trying to work out a way to generate a division equation, where the answer will always be a positive whole number (does not have decimals). This is a snippet of code that I'm using for 'addition' to grab the random numbers

SET /a Num2=(%Random% %%MaxNumber%)+1
echo %QuestNum%) %Num1% + %Num2% =

Upvotes: 1

Views: 313

Answers (1)

Gareth McCaughan
Gareth McCaughan

Reputation: 19981

Choose the answer (which you presumably won't output) and the divisor at random; compute the dividend by multiplying the two (using set /a).

Upvotes: 3

Related Questions