?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$a = 10;
$b = 11;
if ($a < ++$a || $b < ++$b)
print "hello";
else
print "hi";
?>
<?php
$a = 10;
$b = 11;
if ($a < ++$a || $b < ++$b)
print "hello";
else
print "hi";
?>
Answer & Solution
Correct Answer:
Option
A
The operator precedence of ++ is higher than <,thus the incremenrt happens first and then compared.
Join the Discussion
Login to post a comment or share your explanation.
Login