IDENTIFICATION DIVISION.
PROGRAM-ID. EINFALT.

DATA DIVISION.
WORKING-STORAGE SECTION.
  01 N   PIC S9(30).
  01 OUT PIC Z(180).

PROCEDURE DIVISION.
  PERFORM
    ACCEPT N
    COMPUTE OUT = function FACTORIAL(N)
    DISPLAY function TRIM(OUT)
  END-PERFORM.
