Created
November 27, 2016 23:42
-
-
Save RodriAndreotti/8cd042fc1a4774c7a35504e7c1b11b20 to your computer and use it in GitHub Desktop.
Cálculo de Fatorial
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 | |
$n = 10; | |
$fatorial = 0; | |
for($i = 0; $i <= 10; $i++) { | |
if($i == 0) { | |
$fatorial = 1; | |
} | |
else{ | |
$fatorial *= $i; | |
} | |
} | |
echo $fatorial; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment