English

What will be the output of the following PHP code? <?php for ($x = -1; $x < 10;--$x) { print $x; } ?>

Advertisements

Question

What will be the output of the following PHP code?

<?php
for ($x = -1; $x < 10;--$x)
{
print $x;
}
?>

Options

  • 123456713910412

  • 123456713910

  • 1234567139104

  • Infinite loop

MCQ
Advertisements

Solution

Infinite loop

shaalaa.com
Looping Structure
  Is there an error in this question or solution?
Chapter 7: Looping Structure - Evaluation - PART – I [Page 117]
Advertisements
Share
Notifications



      Forgot password?
Use app×