   PRINT a
    NEXT a

    PRINT "Finished! The variable is now:"
    PRINT a
    END
</code></pre>
<p>...which produces an unexpected result:</p>
<pre><code>    10
    20
    30
    40
    50
    Finished! The variable is now:
    60
</code></pre>
<h2><a name="7.8">7.8 Nested loops</a></h2>
<p>Loops can contain other loops. If you want to list the coordinates of all the squares in a grid, you could use two FOR loops, one inside the other.</p>
<pre><code>    FOR x = 1 to 5
        FOR y = 1 to 5
           