Programming Languages C++ Objective
Mar 17, 2013

Which formulas can be used to generate random integers between 1 and 10?

Choose the correct answer:
A) 1 + rand() % (10 - 1 + 1)
B) 1 + (10 - 1 + 1) % rand()
C) 10 + rand() % (10 - 1 + 1)
D) 10 + rand() % (10 + 1)
Detailed Explanation

Option A is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback