"> What will be the output of the following PHP code ?<?php$num

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

There is no increment of num making it infinite.



Your comments will be displayed only after manual approval.