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

The increment happens and then the check happens.



Your comments will be displayed only after manual approval.