Lessons
C++ · Repeating Things · 14. for Loops

step 1 of 7

Say it again

Typing the same line five times? Boring. A loop makes me repeat it for you.

for (int i = 0; i < 3; i++) means: do the part in { } 3 times.

Mission

Make me shout Hooray! 5 times. Change one number only.

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

Press RUN to see what this program does.

Do the mission and Next turns green.

for Loops