how to calculate factorial clojure code example
Example 1: calculate factorial
int factorial(int n) {
int res = 1, i;
for (i = 2; i <= n; i++)
res *= i;
return res;
}
Example 2: how to calculate factorial clojure
(apply * (range n 0 -1)) ; plug in anything for n for n factorial