Answers for "c++ generate random number upper and lower bound"

C++
0

c++ generate random number upper and lower bound

int randomBetween( int lowerBound, int upperBound )
{
  int upperbound, lowerbound;
  int randomBetween = rand() % (upperbound-lowerbound) + upperbound;
  return randomBetween;
}
Posted by: Guest on February-03-2021

Browse Popular Code Answers by Language