1 | # Looping with while |
2 | # While x is less than 11 print out the value of x |
3 | set x 1 |
4 | while {$x < 11 } { |
5 | puts "x = $x" |
6 | incr x |
7 | } |
8 |
9 | #x = 1 |
10 | #x = 2 |
11 | #x = 3 |
12 | #x = 4 |
13 | #x = 5 |
14 | #x = 6 |
15 | #x = 7 |
16 | #x = 8 |
17 | #x = 9 |
18 | #x = 10 |
Recent Comments