[Solved]Don't not understand this final review question that my teacher post up "seeding the random number generator"?

write the code to generate a random number between 50 and 100. initially seeding the random number generator to 25.


initially seeding the random number generator to 25.

what does that mean, "Seeding the random number generator to 25"

do i need to use srand for this question?
Last edited on
closed account (3piU5Di1)
Do i need to use srand for this question?

Yes.

srand(25);
kool, and what does seeding mean?
Each pseudo-random number is generated by performing some calculations on the previous stored value.

Seeding means setting the initial value to be used at the start of the sequence.

http://www.cplusplus.com/reference/cstdlib/rand/
http://www.cplusplus.com/reference/cstdlib/srand/


Topic archived. No new replies allowed.