nested while loop

Kristian Nilssen knilssen at WEATHER3000.COM
Tue Mar 7 05:54:04 EST 2006


The following script should produce output which shows that a nested
loop is executing. However, the inner loop only executes once.

columns = 4
rows = 5
c = 0
r = 0

while(r < rows)
  say 'row '%r
  while(c < columns)
    say 'column '%c
    c = c + 1
  endwhile
  r = r + 1
endwhile

output...
row 0
column 0
column 1
column 2
column 3
row 1
row 2
row 3
row 4



More information about the gradsusr mailing list