First page Back Continue Last page Overview Graphics
A+ Control Statements Cont...
OUT What number should I divide by 10?
READ $a
divideloop WHILE ($a > 0)
$a = ($a – 10)
$b = ($b + 1)
ENDOF divideloop
divideeventest IF ($a == 0) THEN
OUT The number divided evenly into10 the quotient is
PRINT $b
ELSEOF divideeventest
OUT The number divided unevenly into10 the quotient is
PRINT $b
ENDOF divideeventest
END
cookie LOOP
OUT I want exactly one cookie
READ a
ENDOF cookie UNTIL (a == 1)
END
Notes: