Back to table

Undefined Variable

The following is an invalid µOCCAM program. Tests whether the complier checks the integer has been defined or not before use

Program file: /public/cs3/web/ipptests/testprogramme.reject
INT a:
INT b:

SEQ

  a := 199 - 6         -- Integer a is defined before use
  b := 3 * ( a - 6 )   -- Integer b is defined before use

  c := b - a           -- Integer c is not defiened before use