Syntax:
while (expression)
operator
If the expression is True, then the operator will be executed until the expression becomes False.
If the expression is False, then control is passed to the next operator.
Note. The value of the expression is determined before executing the operator. Therefore, if the expression is False from the very beginning, then the operator will not be executed at all.
Example:
while (k < n)
{
y *= x;
k++;
}
|