Help for this page

Select Code to Download


  1. or download this
    sub factorial {
         my $n = shift;
         return $n * &factorial( $n - 1 );
    }
    
  2. or download this
    sub factorial {
         my $n = shift;
         if ( $n == 1 ) { return 1 }
         return $n * &factorial( $n - 1 );
    }