Quiz

Solve a short quiz to test your understanding of the conditional statements in PHP.

1

If x=3 ,y=4, and z=6, what is the value of x, y, and z after executing the following code?

<?php
if ($y + 2 == $z)
{
    $x = $x + 1;
}
else
{
    $z++;
}
?>

A)

x=3, y=4, z=6

B)

x=4, y=4, z=6

C)

x=3, y=4, z=7

D)

x=4, y=4, z=7

Question 1 of 50 attempted

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy