Back to table

Conditional Test

The following is a valid µOCCAM program. This example tests variable assignments and also a small conditional using IF.

Program file: /public/cs3/web/ipptests/conditional-test.accept
SEQ
  INT maxtemp1:
  INT maxtemp2:
  INT result:
  SEQ
    maxtemp1 := 10
    maxtemp2 := 11
    IF
      maxtemp1 < maxtemp2
        result := maxtemp2
      maxtemp1 >= maxtemp2
        result := maxtemp1