?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
for ($i = 0; $i < 5; $i++)
{
for(; $i < 5; $i++)
print"i";
}
?>
<?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.
Join the Discussion
Login to post a comment or share your explanation.
Login