?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
for ($x = 0; $x <= 10; print ++$x)
{
print ++$x;
}
?>
<?php
for ($x = 0; $x <= 10; print ++$x)
{
print ++$x;
}
?>
Answer & Solution
Correct Answer:
Option
A
The value of x is incremented and printed twice before checking,thus last loop it prints 11 and 12.
Join the Discussion
Login to post a comment or share your explanation.
Login