Quiz on Conditional Statements

Test your understanding of the conditional statements in Perl by solving a short quiz in this lesson.

1

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

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)

none of the above

Question 1 of 50 attempted