Counting loops
Here is an example
of nested
FOR
loops:
' Do the loop body ten times FOR LINE = 1 TO 10 ' Print NUM stars in a row LET NUM = 20 PRINT FOR STARS = 1 TO NUM PRINT "*"; NEXT STARS NEXT LINE ' END
The inner loop (emphasised in blue)
has the job of doing "something" for each value of LINE
.
The outer loop has the job of counting LINE
up by ones from
one to ten.
Think just about the inner loop.
Which of the following describes what the inner loop does each time it runs?