QBasic:
Input "Число а=", a
x = a
Do
x = x ^ 2 + 1
n = n + 1
Loop until x >= 1000000
Print a, x, n
max(n) = 7, при a = 0
QBasic:
Input "Число а=", a
x = a
Do
x = x ^ 2 + 1
n = n + 1
Loop until x >= 1000000
Print a, x, n
max(n) = 7, при a = 0