Home

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  $i = 2;
while (++$i){ while ($i --> 0) print $i;
} ?>

A. 210

B. 10

C. no output

D. infinite loop

Correct Answer :

A. 210


The loop ends when i becomes 0.

Related Questions

Which one of the following function is useful for producing a timestamp… Which of the following must be installed on your computer so as to run… What will be the output of the following PHP code ? <?php class myObject… What will be the output of the following PHP code ? <?php define('GOOD_OCTAL',… What will be the output of the following PHP code? <?php $cars = array(Volvo,… What will be the output of the following PHP code ? <?php $color =… What will be the output of the following code?<?php $foo = 'Bob';… What will be the output of the following PHP code? <?php $a = array(A,… What will be the output of the following PHP code? <?php $a1 = array_fill(3,… What will be the output of the following PHP code ? <?php class Constants{… What will be the output of the following PHP code? <?php $a = array(a=>red,… What will be the output of the following PHP code ? <?php $color1 =… What will be the output of the following PHP code ? <?php $i = 0;while(++$i… Which of following variables can be assigned a value to it?i) $3helloii)… What will be the output of the following PHP code ? <?php define(GREETING,… PHP files have a default file extension of.. What will be the output of the following PHP code ? <?php $i = 0;while… What will be the output of the following PHP code? <?php echo (checkdate(4,31,2010)… What will be the output of the following PHP code ? <?php $color1 =… What will be the output of the following PHP code ? <?php $i = ;while… What is the default time(in seconds) for which session data is considered… If the format is F then which one of the following will be returned? What will be the output of the following PHP code ? <?php $i = 0;while… What will be the output of the following PHP code ? <?php $color1 =… What will be the output of the following PHP code? If say date is 22/06/2013.… What will be the output of the following PHP code ? <?php $i = 5;while… What will be the output of the following PHP code ? <?php /*echo Hello… Which one of the following format parameter can be used to identify timezone? What will be the output of the following PHP code ? <?php $i = 5;while… If the directive session.cookie_lifetime is set to 3600, the cookie will…