adplus-dvertising
frame-decoration

Question

What will be the output of the following PHP code ?
<?php
$i = 5;
while (--$i > 0 && ++$i)
{   
    print $i;
}
?><?php
$i = 5;
while (--$i > 0 || ++$i)
{   
    print $i;
}
?>

a.

54321111111….infinitely

b.

555555555…infinitely

c.

54321

d.

5

Answer: (a).54321111111….infinitely

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code ?