-- This program takes a number from standard input and returns -- the factorial of this number to standard output. -- Note that 0 is returned for a negative input. INT factorial: INT result=0: SEQ stdin ? factorial -- input factoral value to be calculated IF factorial >= 0 result := 1 WHILE factorial > 0 SEQ result := (result * factorial) factorial := (factorial-1) stdout ! result