Back to table

Simple SEQ and PAR tests

The following is a valid µOCCAM program. It declares variables and constants, and then evaluates them in SEQ and PAR.

Program file: /public/cs3/web/ipptests/simplemike.accept
INT a = 10:
INT b:
INT c:
INT d:
PAR
  --    testing the sytax
  SEQ
    b := a + 15
    stdin ? c    --get users input and assign value to c
    d := c + b
    WHILE d > 0
      stdout ! d  --output value of d until the condition in the while statement doesnt hold
      d := d - 1  --decrementing so that d > 0 will eventually be false