home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 92 / af092a.adf / af92.lzx / ARexx_Code / factorial.rexx < prev    next >
OS/2 REXX Batch file  |  1988-06-24  |  175b  |  12 lines

  1. /* factorial.rexx */
  2. say 'Pick a number?'
  3. pull x
  4. f=Factorial(x)
  5. say 'the factorial of' x 'is' f
  6. exit
  7.  
  8. Factorial: Procedure
  9. arg n
  10. if n=1 then return(1)
  11. return Factorial(n-1)*n
  12.