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