ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

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

Answer & Solution
Correct Answer: Option C
The order of execution is initialization, check, increment/decrement, check, increment/decrement, check, increment/decrement….so on .
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.