Datasheet

DO STATEMENT
The do statement executes until the condition becomes false. The syntax of the do
statement is:
do statement while (expression);
The statement is executed repeatedly as long as the value of expression remains
non-zero. The expression is evaluated after each iteration, so the loop will execute
statement at least once.
Parentheses around expression are mandatory.
Note that do is the only control structure in C which explicitly ends with semicolon
(;). Other control structures end with statement, which means that they implicitly
include a semicolon or closing brace.
Here is an example of calculating scalar product of two vectors, using the do statement:
s = 0; i = 0;
do {
s += a[i] * b[i];
i++;
} while ( i < n );
213
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5