Created
November 18, 2020 15:03
-
-
Save ultramarshall/c3b2a32b4b076eca2459fd7e5309652a to your computer and use it in GitHub Desktop.
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 DrawAngka($angka) { | |
for ($i = 0; $i < ($angka / 3); $i++) { | |
echo $i+1 . " "; | |
echo $i+5 . " "; | |
echo $i+9 . "<br>"; | |
} | |
} | |
DrawAngka(12); | |
/* | |
output | |
1 5 9 | |
2 6 10 | |
3 7 11 | |
4 8 12 | |
*/ | |
DrawAngka(30); | |
/* | |
output | |
1 5 9 | |
2 6 10 | |
3 7 11 | |
4 8 12 | |
5 9 13 | |
6 10 14 | |
7 11 15 | |
8 12 16 | |
9 13 17 | |
10 14 18 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment