The FOR-DOWNTO-DO Loop Page

The purpose of this program fragment is to show how a loop-control variable can be decremented using the FOR-DOWNTO-DO loop. This fragment prints the first five odd Natural numbers backwards.

The Source

The Variables

1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   NEXT  

The Output

The Source

N.B. This is the only time that the first line will be highlighted. The Turbo Pascal debugger handles the decrement later.



Back to Main Page
© 2001 DFStermole
Last Modified 31 Oct 2001