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

Explanation: Print returns 1,thus it gives case 1.

Explanation by: Parvesh Kanani
Print returns 1,thus it gives case 1.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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