Home » PHP » PHP For Loops » Question
  1. What will be the output of the following PHP code ?
    <?php
    for ($k = 5; $k <= 9; print ++$k)
    {
    print ++$k;
    }
    ?>
    1. Error
    2. Infinite loop
    3. 678910
    4. 67891011
    5. None of these
Correct Option: D

The value of k is incremented and printed twice before checking,this last loop it prints 10 and 11.



Your comments will be displayed only after manual approval.