I am trying to find a random number in between two variables that the user inputs max and min.I need to do this ten times. I seem to be having trouble. Any pointers on how to fix?
cout << "Max?" << endl;
cin >> maximum;
cout << "Min?" << endl;
cin >> minimum;
srand(time(0)); //seed the random number
for(int i=1; i<=10; i++ )
random_number = rand () % (high - low + 1) + low;
(high - low + 1) = double
you cannot apply mod [%] operator on non integral types.
try changing all you variables to ints.
the rest of your logic appears to be good.
Topic archived. No new replies allowed.