Skip to content

Instantly share code, notes, and snippets.

@AdityaBhutani
Last active January 5, 2021 22:00
Show Gist options
  • Save AdityaBhutani/73dbe726137be68d3757c06140c27c53 to your computer and use it in GitHub Desktop.
Save AdityaBhutani/73dbe726137be68d3757c06140c27c53 to your computer and use it in GitHub Desktop.
Factorial
def factorial(n)
return 1 if n==1
n*factorial(n-1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment