

do                          C Keyword                          do




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


































COHERENT Lexicon                                           Page 1


