Next:
for
Up:
Flow control and loops
Previous:
switch
Contents
while and do-while
A while loop is executed repeatedly until its boolean expression evaluates to false.
A while loop will execute zero or more times.
The boolean-expression can be any expression that returns a
boolean
value.
while (boolean-expression) statement
A do-while loop executes at least once:
do statement while (boolean-expression)
Next:
for
Up:
Flow control and loops
Previous:
switch
Contents