Skip to content
CodeKruPro

A loop with continue and break

Predict the outputEasyJava only
Main.java
public class Main {
    public static void main(String[] args) {
        for (int i = 0; i < 8; i++) {
            if (i == 2) {
                continue;
            }
            if (i == 5) {
                break;
            }
            System.out.print(i + " ");
        }
        System.out.println();
        System.out.println("end");
    }
}

Graded by exact match. Spaces at the ends of lines and blank lines at the end do not count.

to answer and keep your progress. Reading is free for everyone.