A

Admin • 828.03K Points
Coach

Q. What will be the output of the following PHP code ?

Code:
<?php
$s = 2.2;
switch($s)
{
case 2.1:
print "Option A";
break;
case 2.2:
print "Option B";
break;
default:
print "Option C";
}
?>
  • (A) Error
  • (B) Option A
  • (C) Option B
  • (D) Option C
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin
it compares it with 2.2 and thus prints Option B and exits.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.