Which of the following is the correct code snippet for throwing a pair of dice to get a sum of the numbers on two dice between 2 and 12 with different probabilities?
A) (int) (Math.random() * 6 + 1)
B) (int) (Math.random() * 12 + 1)
C) (int) (Math.random() * 6 + 1) + (int) (Math.random() * 6 + 1)
D) (int) (Math.random() * 12 - 2)
Correct Answer:
Verified
Q5: What is the output of the following
Q6: What is the output of the following
Q21: What will be the output of the
Q24: What is the result when the following
Q29: What will be the range of the
Q63: Given the following code snippet, what should
Q70: What is the output of the code
Q103: How many times does the following loop
Q105: What is the first and last value
Q112: Which of the following activities can be
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents