1.Write a javascript program to accept a number entered in textbox and find the factorial of that number
Answers
Answered by
2
Answer:
Approaches
function factorial(n){
let answer = 1;
if (n == 0 || n == 1){
return answer;
}else{
for(var i = n; i >= 1; i--){
answer = answer * i;
}
Similar questions