SAI YEWALE

Generation

typingsFri, 25 Nov 2022

Write javascript code to find factorial of given number.(use while loop)

function factorial(n) { var fact = 1; while (n > 0) { fact *= n; n--; } return fact; } document.write(factorial(5));

Questions about programming?Chat with your personal AI assistant