Quiz+3+Programs

EX 1

var counter : int := 0 loop counter := counter +1 put counter : 3 exit when counter = 10 end loop

EX 2

for x: 10..30 by 5 end for

EX 3 var counter: int:=0 loop counter := counter + 1 exit when counter = 3 put counter.. end loop

EX 4

c:=0 loop c:=c+1 drawoval (c, 10, 10, 10, 2) exit when c=10 end loop

EX 5

for decreasing count : 10 .. 1 by 2 put count.. exit when count div 2 = 3 end for

EX 6
 * var c, s : int**
 * c := 10**
 * s := 0**
 * loop**
 * c := c + 1**
 * s := s * s - c**
 * put c : 5, s : 5**
 * exit when s > 100**
 * end loop**