Created
July 6, 2021 04:22
-
-
Save thecodemedia/75cc90edbe0b9c56a38eb1fb121e1fe6 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
# выводим '1 2 3 4 5' четырьмя разными способами | |
$i = 0; | |
while($i < 5) { # пока $i меньше пяти | |
print ++$i." "; | |
} | |
print "\n"; # новая строка | |
$i = 0; | |
until($i == 5) { # пока $i не станет равно пяти | |
print ++$i." "; | |
} | |
print "\n"; | |
$i = 0; | |
do { | |
print ++$i." "; | |
} while ($i < 5); # проверка в конце цикла | |
print "\n"; | |
$i = 0; | |
do { | |
print ++$i." "; | |
} until ($i == 5); | |
print "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment