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

As it is && operator it is being incremented and decremented continuously.



Your comments will be displayed only after manual approval.