or:
while ( )
{
statement1;
statement2;
}
|
Executes the statement as long as the boolean expression is true. If the expression is false from the beginning, it will not execute any statements. If you want the loop to execute your statements at least once, use the Do-While Statement.
Example:
int i = 0;
while (i < 4)
{
writefln("i = %d", i);
i++;
}
|
Output:
|