Question #327022

Create a short program that will generate a random number from 0 to 100 while using Math.random and Math.round command.

Expert's answer

public class App {


	public static void main(String[] args) {
		int number = Math.round((int) (Math.random() * 100));
		System.out.println(number);
	}


}

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!

LATEST TUTORIALS
APPROVED BY CLIENTS