ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.