Divisible by 4

Report a typo

You have an incomplete program that should display all positive numbers divisible by 4, that are less than the number entered by the user. Complete the given code.

Fill in the gaps with the relevant elements
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int limit = scanner.nextInt();

        int number = 0;
         (true) {
            number++;
            if (number > limit) {
                ;
            }
            if (number % 4 != 0) {
                ;
            }
            System.out.print(number + " ");
        }
    }
}

Create a free account to access the full topic