do ... while

do { statement; ... } while (int exp);

Executes a statement or statement block while the integer expression is true (nonzero). The statement or statement block is executed at least once.

if ... else

if (int exp) { statement; ... } [else { statement; ... }]

Executes a statement or statement block, depending on the value of the integer expression. Executes the statement or statement block immediately following if if the integer expression is nonzero, else executes the statement or statement block following else if the integer expression is 0.

The else part is optional. The parenthesis around int exp is optional.

for loops

for (statement1; int exp; statement2) { statement3; ... }

Executes statement1 if it exists, then evaluates the required integer expression. If the integer expression is nonzero, then statement3 is executed, otherwise control returns to the statement immediately following the block that contains statement3. If the statement3 block is executed, statement2 is executed immediately afterwards if it exists. The integer expression is then reevaluated and the loop continues until the integer expression evaluates to zero. statement1 and statement2 are both optional and may be single statements or statement blocks. statement3 may be a single statement or a statement block.

For example, this loop continues while the integer expression is nonzero: execute statement1, evaluate integer expression, execute statement3 block, execute statement2, evaluate integer expression, execute statement3 block, execute statement2, evaluate integer expression, ...

while

while (int exp) { statement; ... }

Continues executing a statement or statement block while the integer expression is true (nonzero).

NOTE: Excessive looping can significantly affect validation performance.