What will be the output of the following PHP code (25)?

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

<?php  
$x = 10; 
  
while ($x < 10) { 
    $x++;
    echo $x, ","; 
} 
?>
  1. Infinite loop
  2. Error
  3. 10, 11,
  4. No output

Answer: D) No output

Explanation:

In the above PHP script, the condition which is written in the while statement is false. Thus, the loop will not be executed and nothing will print.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.