mercredi 1 avril 2020

c++ confusing formula for a random number between x and y

x + (rand() % y - x + 1) this is a formula to find a random number between x and y but I don't know how it was made I want a logical/mathematical explanation for it and thank you in advance.




Aucun commentaire:

Enregistrer un commentaire