L4.5 Loop: Break Statement

PHOTO EMBED

Tue Oct 17 2023 08:38:26 GMT+0000 (Coordinated Universal Time)

Saved by @testpro #java

public class Main {
    public static void main(String[] args) {

        for (int i = 0; i < 10; i++) {
            if (i == 4) {
                break;
            }
            System.out.println(i);
        }
    }
}
/* Output:
0
1
2
3
*/
content_copyCOPY