WHILE...DO

WHILE...DO — is a Turbo Pascal cycle operator.

Examples
WHILE DO

where - is the expression of logic type (True / False).

- any pascal operator.

If the expression of is true then is being performed, after now together love you then expression of the is calculated all over as well as its checking. If has value FALSE, operator WHILE stops its work. If you type 1 (x) answer will be:

1 (it has stored the value of x when at readln(x) - it's the value of x when the program had just started and hasn't passed the latter part of the code)

6 (then 1 + 5(n1))

11 (as from previous x := 6, it started from this value at while x < n do and when it (x) tries to pass again at while x < do it won't satisfy the condition, as 11 < 10)

You can also trace the steps (debug) if you press F8.