samedi 11 mars 2017

how to generate list of 5 random numbers between 20 and 100 in java

i want to generate list of 5 random numbers between 20 and 100.Here is my code

public class RandomNumbers {
    public static void main(String[] args){
        for(int i = 0; i < 5; i++){
            System.out.println((int)(Math.random() * 10));
        }
    }
}




Aucun commentaire:

Enregistrer un commentaire