ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

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";
?>

Answer & Solution
Correct Answer: Option A
The operator precedence of ++ is higher than <,thus the incremenrt happens first and then compared.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.