Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$i = 0;
while($i = 10)
{   
    print "hi";
}
print "hello";
?>

A. hello

B. infinite loop

C. hihello

D. error

Answer: Option B

Solution(By Examveda Team)

While condition always gives 1.

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

Join The Discussion

Related Questions on Control Structures(Loop in PHP)