Which of the following code snippets will generate a random number between 0 and 79?
A) int val = (int) Math.random() % 80;
B) int val = (int) Math.random() * 80 - 1;
C) int val = (int) Math.random() % 79;
D) int val = (int) Math.random() * 80;
Correct Answer:
Verified
Q27: What is the output of the code
Q62: How many times is the text "Let's
Q68: Which of the loop(s) test the condition
Q71: How many times does the following loop
Q79: How many times does the following loop
Q80: Suppose that the chance to hit the
Q85: Which of the following loop(s) should be
Q85: Which statement is correct about the execution
Q89: How do you fix this code snippet
Q115: In the following code snippet, when does
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