ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?php
for ($i = 0; -5 ; $i++)
{
    print"i";
    if ($i == 3)
        break;
}
?>

Answer & Solution
Correct Answer: Option B
The break statement after breaks the loop after i=3,does not print anymore.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.