Created
October 2, 2016 04:23
-
-
Save thaiall/b0b8346b9cd8d51891c77d37d1dc25ee to your computer and use it in GitHub Desktop.
Factorial คือ การกระทำกับค่าเลขจำนวนเต็มบวก
ที่จะนำมาคูณกันตั้งแต่ 1 ถึง ค่าจำนวนเต็มนั้นๆ
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
<script> | |
var myv = fac(5); | |
document.write(myv); | |
function fac(v) { | |
if(v == 0) | |
return 1; | |
else | |
return(v * fac(v - 1)); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment