for bounds change | for..to | for..downto |
Smart pascal source code
var i, lo, hi: Integer; lo := 1; hi := 3; for i := lo to hi do begin WriteLn(i); hi := 1; lo := 3; end; lo := 1; hi := 3; for i := hi downto lo do begin WriteLn(i); hi := 1; lo := 3; end; { <<< CONSOLE OUTPUTS >>> 1 2 3 3 2 1 }