recursive_factorial

Ahmed Magdy · @a7madM · almost 3 years

calculates factorial of a number recursively

def recursive_factorial(n)
return 1 if n == 0
return n * recursive_factorial(n - 1)
end
1 · 2 · 0