ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

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

Answer & Solution
Correct Answer: Option A
The i value is changed in the inner loop and reaches five, thus does not execute the second outer loop.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.