Solution:
FlowChart
Example:
function factorial(n){
if(n === 0){
return 1;}
else{
return n*factorial(n-1);
}
}
testinputs:1) console.log(factorial(6))
2) console.log(factorial(7))
outputs:1) 720, 2) 5040
Solution:
FlowChart
function factorial(n){
if(n === 0){
return 1;}
else{
return n*factorial(n-1);
}
}
testinputs:1) console.log(factorial(6))
2) console.log(factorial(7))
outputs:1) 720, 2) 5040
0 Comments
Thank you for Comment