Javascript with Faktorial

at night, alone, staying up .... huft for os my Garuda (eagle on my chest eagle on my computer) had no problem staying up late to realize the eagle on my computer ....
stayed up late waiting for download as fb's really long so I'm bored, want to post on the blog but there g of material, but tiba2 to inget ma course this morning about the javascript. Completed the factorial by using javascript, the code is shown below ...

<html>
<head>
<title>javascript</title>
</head>
<body>
<script language="javascript" type="text/javascript">
n=prompt("masukkan nilai")
fak=1;
for(x=1;x<=n;x++){
fak=fak*x;
}
document.write("<font size=4 face=impact color=blue>"+n+"!="+fak+" ");
</script>
</body>
</html>

save the file type. html, then open with your browser. Box will appear on the browser as shown below.


Then enter the value to be searched faktorialnya, eg 123. and click ok. Then the browser will show the results.


faktorial 123!=720377385

The End

0 Response to "Javascript with Faktorial"

Post a Comment

Labels