mardi 17 novembre 2015

C++ - rand() function not working, numbers do not go above 32,000

I am trying to create random numbers from 0 to around 200,000, however the values do not go above 33,000. Even if I try a different value they still do not go above 33k. I tried to seed and still nothing. Did I miss something when I learned about this function? Thanks.

srand(time(0));
for (int count = 190000; count < 200000; count++)
    cout << rand() % 200001 << " ";




Aucun commentaire:

Enregistrer un commentaire