Question: Whats wrong with this code? Factorial calculator function getfactorial () { var x = document.getElementById(number).value; var prod=1; for(var i=1;i
Whats wrong with this code?
function getfactorial () {
var x = document.getElementById("number").value;
var prod=1;
for(var i=1;i<=x;i++)
{
prod=prod*i;
}
return prod;
document.getElementById("output").innerHTML = prod;
}
Factorial
calculate
________________
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
