Ask Question

What is the output from system. out. println ((int) (math. random () * 4)) ?

+3
Answers (1)
  1. 26 January, 10:47
    0
    In java, the math. random () function call will return a random number between 0 and 1. Therefore, the call 'math. random () * 4 ' will return a number between 0 and 4. The casting of this call to an integer ' (int) ' will return an integer with no fraction, so numbers 0, 1, 2, 3 or 4.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the output from system. out. println ((int) (math. random () * 4)) ? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers