5 years ago in java.lang Package

Which of the following will output a random with values only from 1 to 10?

[A] System.out.println(Math.round(Math.random()* 10));
[B] System.out.println(Math.round(Math.random() % 10));
[C] System.out.println(Math.random() *10);
[D] None of the above
Loading...
Next Question

Overall Stats

Attempted 113
Correct 13
Incorrect 51
Viewed 49

Answers

Guest
Guest
Shamsa hafeez
Shamsa hafeez - 1 week ago

Shamsa hafeez from Lahore, Pakistan is saying System.out.println(Math.round(Math.random()* 10)); is correct answer

bruh
bruh - 1 month ago

bruh from Guwahati, India is saying System.out.println(Math.random() *10); is correct answer

Vaibhav Bisht
Vaibhav Bisht - 1 month ago

Vaibhav Bisht from Dehradun, India is saying System.out.println(Math.random() *10); is correct answer

Cos Sinus
Cos Sinus - 1 month ago

Cos Sinus from Casablanca, Morocco is saying None of the above is correct answer

Awa Kone
Awa Kone - 1 month ago

Awa Kone from Berrechid, Morocco is saying System.out.println(Math.random() *10); is correct answer

Related Questions

Which of these methods is used to check for infinitely large and small values?

  • [A] isInfinite()
  • [B] isNaN()
  • [C] Isinfinite()
  • [D] IsNaN()

Which of these methods is used to obtain value of invoking object as a long?

  • [A] long value()
  • [B] long longValue()
  • [C] Long longvalue()
  • [D] Long Longvalue()