Computer Studies‎ > ‎Turing‎ > ‎Turing Tutorial‎ > ‎

Turing 024 — For Loops

Another, perhaps more popular kind of loop is the "for loop". A for loop executes a specified number of times. The number of times is specified by an index variable, as shown in the example here:

for count: 1..4
    put "The index counter is ", count
end for

Assignment

Modify 023.t so that it uses a for loop instead of a conditional loop.

Save as "024.t".
Comments