public class Main {
public static void main(String[] args) {
double number = Math.random();
System.out.println("Generated number: " + number);
number = Math.random() * 10;
System.out.println("Generated number: " + number);
number = 100 + (Math.random() * 100);
System.out.println("Generated number: " + number);
int random = 100 + (int) (Math.random() * 100);
System.out.println("Generated number: " + random);
}
}
|