Back to table

Check the SEQ statement

The following is a valid µOCCAM program that performs I/O. The following is a valid programme which performs I/O. The input values are constraint by the constrain x > 0. It stops till a non-positive value comes along.

Program file: /public/cs3/web/ipptests/IOtest.io

INT x:
SEQ
  stdin ? x
  WHILE x > 0
    SEQ
      stdout ! x * 5 
      stdin ? x
    

When provided with this input: /public/cs3/web/ipptests/IOtest.in

6
10
-3
-4

it should generate the following output: /public/cs3/web/ipptests/IOtest.out

==> 30
==> 50