A while statement is used to repeat statements, while a control condition (expression) is evaluated as true. The control condition is evaluated before the statements. Hence, if the control condition is false at first iteration, the statement sequence is never executed. The while statement executes its constituent statement repeatedly, testing expression before each iteration. As long as expression returns True, execution continues.




WHILE (Data[I] <> X)
 I = I + 1 
WHILE (I > 0)
  IF Odd(I) THEN Z = Z * X 
  X = Sqr(X)


loop statements