Help for this page

Select Code to Download


  1. or download this
    fact(4) = 4 * 3 * 2 * 1 = 24
    
  2. or download this
    $ perl -e '
    sub fact { 
    ...
         return $result;}  
    print fact (shift);' 10
    3628800
    
  3. or download this
    fact(1) = 1
    fact (n) = n * fact (n-1)
    
  4. or download this
    $ perl -e '
    sub fact { 
    ...
    } 
    print fact (shift);' 10
    3628800