Q. Which of the following options is the best for generating random integer 0 or 1?
β
Correct Answer: (C)
(int)(Math.random() + 0.5)
Explanation: The correct answer is Option C: (int)(Math.random() + 0.5)