samedi 27 août 2016

randomly generate a number in c++ but only certain multiples

I'm trying to generate a random number to use as a coordinate in c++, the coordinate must be within range of 0-700, the coordinate generated, however, must be a multiple of 20 only,(0,20,40,60,80 etc) is there a way to do this?

I've looked at other tutorials but none show me how to do this.

Any help would be appreciated

cheers :)




Aucun commentaire:

Enregistrer un commentaire