Write a Program in HTML to calculate factorial of a number
Program:
<html>
<head>
<title>Factorial
</title>
</head>
<body>
<h3>
Factorial of Number </h3><BR>
<script
type="text/javascript">
var f=1;
var i;
for (i=1;i<=7;i++)
{
f=f*i;
}
document.write("Factorial
is of 7 is: "+f);
</script>
</body>
</html>
Output:
Factorial of Number
Factorial is of 7 is: 5040