Advertisement
rudnichek

Untitled

Mar 31st, 2020
2,003
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. recursive  function fact(n) result (fact1)
  2.  
  3.     implicit none
  4.     real(qp) ::  fact1
  5.     real(qp), intent(in) :: n
  6.  
  7.     if (n.eq.0.or.n.eq.1) then
  8.        fact1 = 1
  9.        return
  10.     else
  11.        fact1 = n*fact(n-1)
  12.       return
  13.     end if
  14.  
  15.   end function fact
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement