0

Division without remainder - C#

I need a script to generate random Math exercices, but i want that division to be without remainder.

4th Nov 2020, 7:52 PM
Bogdan Constantin
Bogdan Constantin - avatar
2 RĂ©ponses
+ 5
For an algorithm, you can generate two numbers. One number will be the answer and the other will be the divisor. Multiply those two numbers to get the dividend. Then, you ask your user to divide the dividend by the divisor.
4th Nov 2020, 11:49 PM
👑 Prometheus 🇾🇬
👑 Prometheus 🇾🇬 - avatar
+ 5
I really can't understand what you need. But I know you can find good package in Nuget package manger like Math.Net, Alglib,... Math.Net example https://numerics.mathdotnet.com/Random.html [Edited] : after 👑 Prometheus 🇾🇬 comment i catch up what you need After generating a random integer, you can get all the multiples of the number, using the for loop, but this seems difficult. Therefore, I recommend the Prometheus method.
4th Nov 2020, 9:12 PM
hossein B
hossein B - avatar