Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$x;
if ($x == 0)
    print "hi" ;
else
    print "how are u";
    print "hello"
?>

A. how are uhello

B. hihello

C. hi

D. no output

Answer: Option B

Solution(By Examveda Team)

else condition without brackets performs the following statements only.

Join The Discussion

Related Questions on Control Structures(Loop in PHP)