 imposed by machine arithmetic.  If the initial value of
    v is invalid, the program returns -1 as the answer.

<pre>
PROGRAM Factorial (v : INTEGER) : INTEGER;

CONST
    limit = 7;

VAR
    c : INTEGER;
    fact : INTEGER;

BEGIN
    IF (v < 0) OR (v > limit) THEN
        RETURN -1
    ELSE
        c := 0;
        fact := 1;
        WHILE c < v DO
            c := c + 1;
            fact := fact * c
        END;
        RETURN fact
    END
END Factorial.
</pre>

    <hr>
    <address><a href="mailto:asl