15-recursividad.lua 127 B

123456789
  1. local function factorial(num)
  2. if num <= 1 then
  3. return 1
  4. end
  5. return num * factorial(num - 1)
  6. end
  7. print(factorial(5))