1.

What will be the output of the following PHP code ?
<?php
function fun($opt)
{
switch($opt)
{
case 10:
echo 'Case 10 will execute.';
break;
case 20:
echo 'Case 20 will execute.';
break;
case 30:
echo 'Case 30 will execute.';
break;
case 40:
echo 'Case 40 will execute.';
break;
default:
echo 'Default will execute.';
break;
}
}
fun(20);
?>

A. Case 10 will execute.
B. Case 20 will execute.
C. Case 30 will execute.
D. Case 40 will execute.
E. Default will execute.
Answer» C. Case 30 will execute.


Discussion

No Comment Found

Related MCQs