Skip to content
Quiz · Loops · lesson 6 of 8

Quiz — continue and break

What does the program print?

JAVA
public class Main {
    public static void main(String[] args) {
        for (int i = 1; i <= 10; i++) {
            if (i % 2 == 0) {
                continue;
            } else if (i > 7) {
                break;
            }
            System.out.print(i);
        }
    }
}