RosettaCodeData/Task/Factorial/PowerShell/factorial-3.psh
2023-07-01 13:44:08 -04:00

6 lines
124 B
Text

function Get-Factorial ($x) {
if ($x -eq 0) {
return 1
}
return (Invoke-Expression (1..$x -join '*'))
}