The statements inside the loop are executed a THIRD time:
PRINT
statement prints a prompt.INPUT
statement gets
a number to put in the
variable NUMBER
.
PRINT
statement prints "6% of the number is" and then computes
and prints 200 * 0.06.LOOP
statement marks the end of the loop.Now the monitor shows:
Type a number ? 100 6% of the number is 6 Type a number ? 50 6% of the number is 3 Type a number ? 200 6% of the number is 12
The variable NUMBER
has the new value of 200 in it:
200 |
The program will continue forever, performing the statements
inside the DO
... LOOP
again and again.
If you run this program,
you will have to stop it,
somehow.
To stop the program, hit CONTROL-BREAK.
(Hold down the key marked "Ctrl" then tap the key marked "Break.")
Why not just let the program run until it ends?