I am working on assigning C ++ to my class, and we should use rand () with seed 99 to create a set of values. However, my problem is that when I try to create a value in our parameters, the number is different from what the instructor provided us for a specific first number. The code is shown below:
int lottoNumber;
srand (RANDOM_NUMBER_SEED);
do
{
lottoNumber = rand ();
} while (lottoNumber > 25 || lottoNumber < 1);
cout << lottoNumber << endl;
The value obtained from this is 13, and the number to be produced is 2. Any help as to why this is different would be great, thanks!
source
share