Created
May 21, 2013 17:59
-
-
Save ardbytes/5621855 to your computer and use it in GitHub Desktop.
Factorial in Clojure
This file contains 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 factorial [n] | |
(apply * (range 1 (inc n)))) | |
(println (format "Factorial of 5 is: %s" (factorial 5))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment