Do Statement Definition
Previous Topic  Next Topic 

The do_statement is similar to the  while_statement except that the conditional expression is carried out at the end of the loop, guaranteeing that the loop will excecute the main statement_block at least once (whereas for a while loop, if the expression evaluates to zero then the loop may not execute any of the statements in the statement_block).    The sytax of the do_statement is as follows:


do

    statement_block

until ( expr ) ;