lundi 1 mars 2021

I can´t print out 0 . Can someone tell me why?

I can´t print out 0 . Can someone tell me why?

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner read = new Scanner(System.in);
        System.out.print("Number: ");
        int number = read.nextInt();
        //your code goes here
        while (number >= 0) {
            if(number % 3 == 0) {
                number--;
                continue;
            }
            System.out.println(number);
            number--;
        }
    }
}

Aucun commentaire:

Enregistrer un commentaire