6 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

Create your Digital Resume For FREE on your name's sub domain "yourname.wcard.io". Register Here!


Overall Stats

Attempted 126
Correct 13
Incorrect 56
Viewed 57

Answers

Guest
Guest
Megha Bendre
Megha Bendre - 1 month ago

Megha Bendre is saying System.out.println(Math.random() *10); is correct answer

Afzal T Salim
Afzal T Salim - 4 months ago

Afzal T Salim is saying System.out.println(Math.round(Math.random()* 10)); is correct answer

Bharath
Bharath - 9 months ago

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

shubham adne
shubham adne - 11 months ago

shubham adne from Pune, India is saying System.out.println(Math.random() *10); is correct answer

Shalini M
Shalini M - 1 year ago

Shalini M is saying System.out.println(Math.round(Math.random()* 10)); is correct answer

Related Questions

Which of these is a process of converting a simple data type into a class?

  • [A] type wrapping
  • [B] type conversion
  • [C] type casting
  • [D] None of the Mentioned.