RosettaCodeData/Task/Factorial/PowerShell/factorial-1.psh

7 lines
116 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
function Get-Factorial ($x) {
if ($x -eq 0) {
return 1
}
return $x * (Get-Factorial ($x - 1))
}