2009-09-18, 08:22 PM
Fiel Wrote:lowerBound = 25Yes it is. That expression is added to lowerBound, making the range exactly what it needs to be.
upperBound = 75
rand() % (75 - 25 + 1)
rand() % (51)
So it will generate a number between 0 and 50 - not really what you want.
The +1 is needed, if you want to be accurate. Unless upperBound isn't supposed to be inclusive.

