Last active
September 29, 2018 21:06
-
-
Save ep4sh/6bc87309a6b116a9f9903eb50ad65b1b to your computer and use it in GitHub Desktop.
test Loftschool php #1
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 | |
for ($i=1; $i<=10; $i++) { | |
if (($i % 2) == 0) { | |
echo $i." "; | |
} | |
} | |
?> |
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 | |
define("MIN", 1); | |
define("MAX", 100); | |
$randX = random_int(MIN,MAX); | |
$randY = random_int(MIN,MAX); | |
function sum($x,$y) { | |
return $x+$y; | |
} | |
$summ = sum($randX,$randY); | |
// output | |
echo "<h5>Первое псевдослучайное = ".$randX."</h5>"; | |
echo "<h5>Первое псевдослучайное = ".$randY."</h5>"; | |
echo "<h5>Сумма чисел = ".$summ."</h5>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment