Created
July 26, 2012 14:49
-
-
Save rahulkmr/3182490 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn fact-iter [product counter max-count] | |
| (if (> counter max-count) | |
| product | |
| (recur (* counter product) (inc counter) max-count))) | |
| (defn factorial [n] | |
| (fact-iter 1 1 n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment