lundi 21 décembre 2020

How can I check my array is greater than 99 in Java?

I have a code like this. I'm taking an array from user, but I want to check the numbers are greather than 99. How can I do this? Thank you for response.

public static void main(String[] args) {
     int i = 0;
    int dizi[] = new int[5];
    Scanner scanner = new Scanner(System.in);

    System.out.println("3 basamaklı 5 tane sayı giriniz.");

    for (i = 0; i < dizi.length; i++) {
        dizi[i] = scanner.nextInt();
    
    }
 System.out.println("Girilen dizi:");
 System.out.println(Arrays.toString(dizi));
}

Aucun commentaire:

Enregistrer un commentaire