Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Задание на подготовку к курсу PHP
<!DOCTYPE html>
<html lang="ru-RU">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>Вводное ДЗ по курсу PHP</title>
</head>
<body>
<?php
/* Задание 1 */
$a = 2;
$b = rand(1, 100);
echo 'Результат сложения 2 и случайного числа - '.($a + $b). '<br>';
/* Задание 2 */
echo 'Четные числа от 1 до 10 <br>';
for ($i = 1; $i <= 10; $i++) {
if ($i%2 == 0) echo $i.' ';
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment