Home » PHP » PHP While Loops » Question
  1. What will be the output of the following PHP code ?
    <?php
    $num = 0;
    while (++$num && --$num)
    {
    print $num;
    }
    ?>
    1. 0
    2. Error
    3. 0123457........infinite time
    4. Nothing
    5. None of these
Correct Option: C

The first condition itself fails thus the loop exists.



Your comments will be displayed only after manual approval.