πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$opt = "1";
switch ($opt)
{
case 1:
    print "Hello ";
case 2:
    print "MCQ";
default:
    print "Buddy";
}
?>
  • (A) Hello MCQ Buddy
  • (B) MCQ
  • (C) Buddy
  • (D) Hello
πŸ’¬ Discuss
βœ… Correct Answer: (A) Hello MCQ Buddy

Explanation: As break is not provided it executes all the cases.

Explanation by: Parvesh Kanani
As break is not provided it executes all the cases.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
189
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Parvesh Kanani
Publisher
πŸ“ˆ
90%
Success Rate