ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?php
switch($b)
{
case 2:
    print "hello";
    break;
case 1:
    print "hi";
    break;
}
?>

Answer & Solution
Correct Answer: Option C
If that case does not exist then it searches for default and on not finding it does nothing.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.