Skip to content

Instantly share code, notes, and snippets.

@avgerin0s
Created December 4, 2012 22:04
Show Gist options
  • Save avgerin0s/4209310 to your computer and use it in GitHub Desktop.
Save avgerin0s/4209310 to your computer and use it in GitHub Desktop.
Factorial
def factorial(n)
if n == 0
1
else
n* fact(n-1)
end
end
puts factorial(ARGV[0].to_i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment