function factorial_recursion(n) {
if(n!=1) n * factorial_recursion;
}
function factorial_iteration(n) {
a = n;
while(n!=1) {
n = n -1;
a *= n;
}
return a;
}
function factorial_recursion(n) {
if(n!=1) n = n * factorial_recursion(n-1);
return n;
}
function factorial_recursion(n) {
if(n==0) return 1;
if(n!=1) n * factorial_recursion(n-1);
return n;
}
and :function factorial_iteration(n) {
if(n==0) return 1;
a = n;
while(n!=1) {
n = n -1;
a *= n;
}
return a;
}
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
How can i get the length? | 7 | 33 | |
Mobile page Scrolling down when refreshing | 4 | 33 | |
Optimize simple Javascript code to use no repetitions | 12 | 32 | |
I was able to prove the index of the even , how can i get the even index? | 4 | 16 |
Join the community of 500,000 technology professionals and ask your questions.