Examveda
Examveda

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

A. infinite loop

B. hihello

C. hello

D. error

Answer: Option B

Solution(By Examveda Team)

The do while loop executes atleast once as the condition is in the while loop.

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

Join The Discussion

Related Questions on Control Structures(Loop in PHP)