C Easy recursive routine

      recursive subroutine fact(f, n)
      integer f, n

      if ( n <= 1 ) then
       f = 1
      else
       call fact(f, n - 1)
       f = f*n
      end if
      end subroutine fact

      program tfact

      integer fn

      print *, "n < 0 to quit"
      while ( .true. ) do
       print *, "n > "
       read *, n
       if ( n < 0 ) go to 99
       fact(fn, n)
       print *, "fact(n) = ", n
      end do
 99   continue
      end program tfact
