#!/usr/pkg/bin/wsbasic
#simple for loops
print "simple for:"
for i=0 to 5 print "i=",i

print "i after loop=",i

  
#nested for loop
print "now a nested for:"
    
for i=1 to 3
  for j=1 to 3 begin
    print "i=",i," j=",j
  end


print "for loop with step:"
#for loop with a step
for k=10 to 1 step -2
begin
  print "k=",k
end
  
print "for loop with wrong step"
a=-5
b=1
for i=5 to a step b
  print "i=",i

