Question: Develop a function int getRandom(int min, int max) that returns a random number in range min to max (both limits inclusive). Hint: The function int
Develop a function int getRandom(int min, int max) that returns a random number in range min to max (both limits inclusive). Hint: The function int rand(),declaredinreturnsapseudo-random integer value between 0 and the constant RAND MAX. Hence the expression rand()%Number always yields an integer value between 0 and Number-1 (inclusive). Feel free to use a suitable seed value - however, this is not required.
Step by Step Solution
There are 3 Steps involved in it
To develop the function int getRandomint min int max that returns a random number within the specified range including both limits we need to make use ... View full answer
Get step-by-step solutions from verified subject matter experts
