Monday, July 18, 2011

I am trying to create a C++ program that will generate a random number?

The rand function returns a "random" positive integer from 0 to a large value (at least 32,767) every time it is called. To scale the value into the range you want, use the mod (%) operator and addition.

No comments:

Post a Comment