do loop, and
for loop. We’ll cover the
while loop in this section, and the
for loops later in the chapter.
while loop is the most flexible of the three types of loops. You can use it for any task that needs repetitive operations. FIGURE 10.1 shows the syntax and semantics for the
while loop. The syntax at the left of the figure should look familiar because it’s similar to the
if statement syntax. In the
while loop’s heading, after ...