Today's objective is to create a function that takes in a number and uses a recursive algorithm to find the factorial of that number. Given the number 9 your program should output 362880.
Today's objective is to create a function that takes in a number and uses a recursive algorithm to find the factorial of that number. Given the number 9 your program should output 362880.
Permalink: http://problemotd.com/problem/factorial-finder/
Content curated by @MaxBurstein
Comments:
Heroka - 10 years, 3 months ago
In R:
reply permalink
David - 10 years, 3 months ago
In C by switch.
I like having 2 also be a base case, because something about bothering to multiply by 1 bugs me.
Never the less:
reply permalink
Anonymous - 10 years, 3 months ago
One of the most satisfying haskell example :D
reply permalink
malboy - 10 years, 3 months ago
Did this one in C#:
reply permalink