# Looping with while
# While x is less than 11 print out the value of x
set x 1
while {$x < 11} {
    puts "x = $x"
    incr x
}

#x = 1
#x = 2
#x = 3
#x = 4
#x = 5
#x = 6
#x = 7
#x = 8
#x = 9
#x = 10

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading