1.

Assume that the random number generating function - rand( ), returns an integer between 0 and 10000 (both inclusive). If you want to simulate the throwing of a die using this random function, use the expression

A. rand ( ) % 6
B. rand ( ) % 6 + 1
C. rand ( ) % 5 + 1
D. None of the above
E.
Answer» C. rand ( ) % 5 + 1


Discussion

No Comment Found

Related MCQs