Last active
November 13, 2016 10:04
-
-
Save cordx56/5c265e0672e0bd51086921c83fefa706 to your computer and use it in GitHub Desktop.
It outputs '56' to your console. That's all.
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
<?php | |
function math_fact($n) { | |
$r = 1; | |
for (; $n > 0; $n--) { | |
$r *= $n; | |
} | |
return $r; | |
} | |
// 8!/(8-2)! == _8 P _2 | |
$res = math_fact(8) / math_fact(8 - 2); | |
print $res; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment