0
Which means 98 in the srand()?
int main () { srand(98); for (int x = 1; x <= 10; x++) { cout << 1 + (rand() % 6) << endl; } } What is the function of that parameter "98" and what is its range?
1 Respuesta
+ 4
void srand(unsigned int seed)
seed -- This is an integer value to be used as seed by the pseudo-random number generator algorithm.
This function does not return any value.
Seeding with current system time helps in generating different number everytime.
It is invoked one time only prior to calling rand