The for
statement is
a convenient way to program counting loops.
It also can be used to build all three types of loops.
Anything it does could also be done with the fundamental control
statements you already know.
But the for
statement often says just what you want in a
compact, easily understood format.
for
statementfor
statement in counting loopsfor
and while
loopsWhat are the three types of loops?