logo

Crowdly

Дано код: $numbers = [1, 2, 3, 4, 5, 0]; $count = 0; foreach ($numbers as ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Дано код:

$numbers = [1, 2, 3, 4, 5, 0];

$count = 0;

foreach ($numbers as $key => $number) {

    if ($number % 2 = 0) {

        echo "$key: $number парне<br>";

        $count++;

    } else {

        echo "$key: $number непарне<br>";

    }

}

echo "Всього парних: $count";

Питання: 

А) Знайдіть і поясніть помилку в коді.

Б) Як її виправити?

В) Який результат буде після виправлення?

More questions like this

Want instant access to all verified answers on moodle.elct.lnu.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!