Social Sciences, asked by sahilsurwase06590, 7 months ago

1.Write a javascript program to accept a number entered in textbox and find the factorial of that number​

Answers

Answered by Shivammeena27608
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