Page 1 of 1

Which of the following will generate random numbers in the range 1-100 (both inclusive)?

Posted: Wed Jul 13, 2022 6:16 pm
by answerhappygod
a) rand() % 100
b) rand() % 101
c) (rand() % (101)) + 1
d) (rand() % (100)) + 1