Home / CSE / PHP - CS :: Discussion

Discussion :: PHP - CS

  1. What will be the output of the following PHP code ?

    <?php

    $i = 2;

    while (++$i)

    {

    while (--$i > 0)

    print $i;

    }

    ?>

  2. A.

     210

    B.

     10

    C.

     no output

    D.

     infinite loop

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    The loop never ends as i is always incremented and then decremented.


Be The First To Comment