mardi 19 septembre 2017

Is it possible to select random numbers from a defined set of numbers

Random function usually generates random numbers within a given range. But is it possible to randomly select from a pre-defined list? For example i have [1,4,5,6] and i want to randomly select from this list only. If so, how? Thanks :) P.s:: C++ code would help me a big deal ^^




Aucun commentaire:

Enregistrer un commentaire