"> What will be the output of the following PHP code ?<?phpfor

Home » PHP » PHP For Loops » Question
  1. What will be the output of the following PHP code ?
    <?php
    for ($z = 0; $z < 20; $z++)
    {
    print "Mania";
    break;
    print "Interview";
    }
    ?>
    1. Interview 20 times
    2. Interview
    3. Mania
    4. Mania 20 times
    5. None of these
Correct Option: C

When break is encountered it leaves the loop.



Your comments will be displayed only after manual approval.