PROGRAM factorial

  IMPLICIT NONE
  INTEGER :: N, i, fac
  
  PRINT *, "Dwse arithmo (ws to 12)"
  READ *, N

  IF (N > 12) STOP

  fac = 1
  DO i = 1,N
     fac = fac * i
  END DO

  PRINT *, "To ", N, "!  einai", fac

END PROGRAM factorial
