πŸ“Š PHP
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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Option B

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
215
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Parvesh Kanani
Publisher
πŸ“ˆ
83%
Success Rate