home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / fractrace / FTS-Files / Factorial < prev    next >
Text File  |  1990-07-21  |  180b  |  14 lines

  1. \ Factorial
  2. \ Calculates the factorial of n
  3.  
  4. var n,factorial,this           
  5.  
  6. n=6
  7. factorial=1
  8. if n>1
  9.  for this=n to 1 by -1
  10.   factorial=factorial*this
  11.  endfor
  12. endif
  13. show factorial
  14.