0
when we make ( 1+rand()%6 ) ,why it always get 6 6 6 5 5 ?? why this numbers ?
3 ответов
+ 5
rand() is random number generator .. %6 produces numbers between 0 to 5 and plus 1 will give u numbers between 1 to 6 .. ie random numbers between 1 to 6 .. simple !!
0
rand () is used to generate random numbers so each time u compile u will get different answer.
0
You have to seed your pseudorandom number generator.