Q357
hat is the correct formula for generating random numbers in the range (lower,upper) using rand()?
A.
rand() % (upper - lower)
B.
rand() + lower
C.
(rand()%(upper-lower)) + lower
D.
(rand()%(upper-lower+1)) + lower
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board