Created
April 25, 2017 12:07
-
-
Save yvan-sraka/e8913d15a9f0d65aa4dfb3608becbacc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| // ALGORITHME | |
| function max2($a, $b) { | |
| if ($a > $b) { | |
| return $a; | |
| } else { | |
| return $b; | |
| } | |
| } | |
| // TESTS | |
| echo max2(2, 5)."\n"; | |
| echo max2(-2, -5)."\n"; | |
| echo max2(2.1, 2.5)."\n"; | |
| echo max2("bar", "foo")."\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment