Q. Write a javascript program to find factorial of a number.in html code example
Example: factorial program in javascript
function fact(N){
if(N <= 1){
return "1";
}
else
{
return N * fact(N-1);
}
}
fact(5);
function fact(N){
if(N <= 1){
return "1";
}
else
{
return N * fact(N-1);
}
}
fact(5);