?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$i = 2;
while (++$i)
{
while (--$i > 0)
print $i;
}
?>
<?php
$i = 2;
while (++$i)
{
while (--$i > 0)
print $i;
}
?>
Answer & Solution
Correct Answer:
Option
D
The loop never ends as i is always incremented and then decremented.
Join the Discussion
Login to post a comment or share your explanation.
Login