FIT
100
© Copyright 1999-2000 University of Washington
Visualizing Nested For Loops
v
We can show this graphically by drawing a box
around the inner loop:
v
Dim i As Integer, j As Integer
For i = 1 To 3
For j = 1 To 2
Print i, j
Next j
Next i
Result:
1
1
1
2
2
1
2
2
3
1
3
2