COHERENT manpages

This page displays the COHERENT manpage for do [Introduce a loop].

List of available manpages
Index


do -- C Keyword

Introduce a loop

do is a  C control statement that introduces a  loop.  Unlike for and while
loops,  the condition  in a  do loop  is evaluated  after the  operation is
performed.  do always works in tandem with while; for example

do {
    puts("Next entry? ");
    fflush(stdout);
} while(getchar() != EOF);

prints a prompt on the screen and waits for the user to reply.  The do loop
is convenient in this instance because the prompt must appear at least once
on the screen before the user replies.

See Also

break,
C keywords,
continue,
while
ANSI Standard, §6.6.5.2