Skip to content

Instantly share code, notes, and snippets.

Last active July 17, 2018 10:46
What would you like to do?
Factorial of a number
<!doctype html>
function show(){
var i, no, fact;
for(i=1; i<=no; i++)
fact= fact*i;
document.getElementById("answer").innerHTML= fact;
Enter Num: <input id="num">
<button onclick="show()">Factorial</button>
<h3 id="answer"></h3>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment