Sail E0 Webinar

MCQs

Total Questions : 74 | Page 4 of 8 pages
Question 31. What will be the output of the following PHP code ?$a = "2";switch ($a) {case 1:print "hi";case 2:print "hello";break;default:print "hi1";}
  1.    hihi1
  2.    hello
  3.    hi1
  4.    hihellohi1
 Discuss Question
Answer: Option B. -> hello
Question 32. What will be the output of the following PHP code ?$a = "1";$a = 1;$b = 1;switch($a) {case $a * $b:print "hi";break;case $a / $b:print "hello";break;default:print "hi1";}
  1.    hihellohi1
  2.    hi
  3.    hihello
  4.    hi1
 Discuss Question
Answer: Option B. -> hi
Question 33. What will be the output of the following PHP code ?$a = "1";switch($a) {case 1:break;print "hi";case 2:print "hello";break;default:print "hi1";}
  1.    hi1
  2.    hihi1
  3.    no output
  4.    hihellohi1
 Discuss Question
Answer: Option C. -> no output
Question 34. What will be the output of the following PHP code ?$a = 97;switch(?$a) {case "a":print "hi";break;case 97:print "hello";break;default:print "hi1";}
  1.    hi
  2.    hello
  3.    hihello
  4.    hihellohi1
 Discuss Question
Answer: Option B. -> hello
Question 35. What will be the output of the following PHP code ?$b = 1;switch($b) {case 1.0:print "hi";break;case 1:print "hello";break;default:print "hi1";}
  1.    hihello
  2.    hello
  3.    hi
  4.    hihellohi1
 Discuss Question
Answer: Option D. -> hihellohi1
Question 36. What will be the output of the following PHP code ?while() {print "hi";}
  1.    error
  2.    hi
  3.    infinite loop
  4.    no output
 Discuss Question
Answer: Option A. -> error
Question 37. What will be the output of the following PHP code ?switch($b) {case 2:print "hello";break;case b:print "hi";break;}
  1.    hello
  2.    hi
  3.    error
  4.    no output
 Discuss Question
Answer: Option D. -> no output
Question 38. What will be the output of the following PHP code ?const $b = 1;switch($b) {case 1:print "hi";break;case 1:print "hello";break;default:print "hi1";}
  1.    hihello
  2.    hello
  3.    error
  4.    hi
 Discuss Question
Answer: Option C. -> error
Question 39. What will be the output of the following PHP code ?$b = 1;switch(print $b) {case 2:print "hello";break;case 1:print "hi";break;default:print "hi1";}
  1.    1hi
  2.    1hello
  3.    error
  4.    1hi1
 Discuss Question
Answer: Option A. -> 1hi
Question 40. What will be the output of the following PHP code ?switch($b) {case 2:print "hello";break;case 1:print "hi";break;}
  1.    hello
  2.    hi
  3.    error
  4.    no output
 Discuss Question
Answer: Option D. -> no output

Latest Videos

Latest Test Papers