Skip to content
Course map | Lesson 4 of 5

Control Flow · 3.4

break and continue

All lessons are open — jump whenever you need.

break exits the loop, continue skips to the next iteration:

for i in 0..10 {
    if i % 2 == 0 { continue } // skip evens
    if i > 7 { break }          // stop at 7
    print(i) // 1, 3, 5, 7
}

Goal: Print only the multiples of 3 between 1 and 30.

lesson-3-4.zolo
Program output

Run the code to see the output

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br