Answer to Question #111891 in Java | JSP | JSF for Flores

Question #111891
What value(s) will be output by the following Java code statements?
System.out.println( (int)(Math.random()*5) + 3 ); _________________
System.out.println( (int)Math.random()*4 + 5 ); _________________
System.out.println( (int)(Math.random()*50) );
1
Expert's answer
2020-04-27T01:57:09-0400
System.out.println( (int)(Math.random()*5) + 3 ); // int from 3 to 8

System.out.println( (int)Math.random()*4 + 5 ); //always int 5

System.out.println( (int)(Math.random()*50) ); // int from 0 to 50  

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS