2009-09-15, 11:35 PM
Shouldn't it be (rand() % (upperBound - lowerBound + 1))?
In that case the only way there'd be a division by 0 is if upperBound < lowerBound, which is tested against.
And it asks for an upperBound and lowerBound, then displays the instructions (what 1, 2, and 3 mean), then displays a guess before asking a number.
In that case the only way there'd be a division by 0 is if upperBound < lowerBound, which is tested against.
And it asks for an upperBound and lowerBound, then displays the instructions (what 1, 2, and 3 mean), then displays a guess before asking a number.

