<html>
<head>
<script language="JScript" >
function fact()
{
x=0;
s=1
x=eval(prompt("Enter Number"))
if (x>1)
{for(i=1;i<=x;i++)
{s*=i}
alert("Factorial For " + x + "= " + s)
}
else
{
alert("Wrong Value")
}
}
</script>
</head>
<body onload="fact()">
</body>
</html>
No comments:
Post a Comment