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

7 lines
116 B
Plaintext

function Get-Factorial ($x) {
if ($x -eq 0) {
return 1
}
return $x * (Get-Factorial ($x - 1))
}