Created
November 27, 2019 03:42
-
-
Save john212/4cad7158381af19d1e97a6daa2edd059 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/dodokeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
// factorial function | |
// factorial of integer > 1 | |
z = myFactorial(10); | |
document.write(z); | |
function myFactorial(z_) | |
{ | |
counter = z_; | |
product = 1; | |
while (counter >= 1) | |
{ | |
product = counter*product; | |
counter = counter - 1; | |
} | |
return product; | |
} | |
// → 55 | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
// factorial function | |
// factorial of integer > 1 | |
z = myFactorial(10); | |
document.write(z); | |
function myFactorial(z_) | |
{ | |
counter = z_; | |
product = 1; | |
while (counter >= 1) | |
{ | |
product = counter*product; | |
counter = counter - 1; | |
} | |
return product; | |
} | |
// → 55</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// factorial function | |
// factorial of integer > 1 | |
z = myFactorial(10); | |
document.write(z); | |
function myFactorial(z_) | |
{ | |
counter = z_; | |
product = 1; | |
while (counter >= 1) | |
{ | |
product = counter*product; | |
counter = counter - 1; | |
} | |
return product; | |
} | |
// → 55 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment