Tuesday, July 22, 2008

Factorial By VB Script

<html>

<head>

<script language="vbscript" >

sub fact

s=1

x=eval(inputbox("Enter Number"))

if x>0 then

for i=1 to x

s=s*i

next

alert("Factorial For " & x & " = " & s)

else

alert ("Wrong Value")

end if

end sub

</script>

</head>

<body onload="fact()">

</body>

</html>

No comments: