?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$x = 1;
if ($x--)
print "hi"
$x--;
else
print "hello"
?>
<?php
$x = 1;
if ($x--)
print "hi"
$x--;
else
print "hello"
?>
Answer & Solution
Correct Answer:
Option
C
The if statement has no brackets and it expects a else/else if after a if.
Join the Discussion
Login to post a comment or share your explanation.
Login