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

Home » PHP » PHP While Loops » Question
  1. What will be the output of the following PHP code ?
    <?php
    $p = 5;
    while($p = 20)
    {
    print "INDIA";
    }
    print "USA";
    ?>
    1. 5
    2. 20
    3. USA
    4. INDIA.....infinite time
    5. USA.....infinite time
Correct Option: D

While condition always gives 1.



Your comments will be displayed only after manual approval.