FUNCTION parag(k)
  IMPLICIT NONE
  INTEGER, INTENT (in) :: k
  INTEGER :: parag

  INTEGER :: i

  parag = 1 
  DO i=1,k
     parag = parag * i
  ENDDO

END FUNCTION parag


PROGRAM factorial
  IMPLICIT NONE

  INTERFACE
     FUNCTION parag(k)
       IMPLICIT NONE
       INTEGER, INTENT (in) :: k
       INTEGER :: parag

     END FUNCTION parag
  END INTERFACE

  PRINT *, parag(3), parag(5), parag(7)

END PROGRAM factorial
