Lessons
C++ · Repeating Things · 16. Controlling a Loop

step 1 of 6

Stop right now

I print every number from 1 to 30 that 7 divides. But you only want the first one.

break; makes me leave the loop at once.

Mission

Add break; so I stop after the first one I find.

PIP·1
main.cppyour code
1
2
3
4
5
6
7
8
9
10
11
← press me!
readyscreen

Press RUN to see what this program does.

Do the mission and Next turns green.

Controlling a Loop