In the
while
loop (pseudo code)
while (<CONDITION>);
The
empty statement is executed while the assertion <CONDITION> is non-zero, for instance
while (5);
is an infinite (empty) loop.
On the other hand, a semicolon is
required after the
while
in the
do-while
loop, to close the statement:
do
c = getchar();
while ( c != EOF );