Examveda
Examveda

What will be the output of the following PHP code ?
<?php
for ($i++; $i == 1; $i = 2)
    print "In for loop ";
    print "After loopn";
?>

A. In for loop

B. After for loop

C. In for loopAfter for loop

D. Infinite loop

Answer: Option C

Solution(By Examveda Team)

The loop runs only once as value of x is incremented.

This Question Belongs to PHP >> Control Structures(Loop In PHP)

Join The Discussion

Related Questions on Control Structures(Loop in PHP)