1

Hey I'm new a wanted to know how I can create a random number generator within a given range that can be changed as code is run( say range starts as 0 to 1000, but later can be modified to 430-600)

I have something like this (v is max and i is min) Pls Help!

int range = (v - i )+ 1;
srand(time(0));
Guess = rand() % range+ i;
smac89
  • 39,374
  • 15
  • 132
  • 179

0 Answers0