Sail E0 Webinar

MCQs

Total Questions : 74 | Page 3 of 8 pages
Question 21. What will be the output of the following PHP code ?$x = 10;$y = 5;$z = 3;if ($x / $y / $z)print "hi";elseprint "hello";
  1.    hello
  2.    no output
  3.    hi
  4.    error
 Discuss Question
Answer: Option C. -> hi
Question 22. What will be the output of the following PHP code ?if (!print "hi")if (print "hello")print "hi";
  1.    hihellohi
  2.    hihi
  3.    hi
  4.    no output
 Discuss Question
Answer: Option C. -> hi
Question 23. What will be the output of the following PHP code ?if (print "hi" - 1)print "hello"
  1.    hi
  2.    hihello
  3.    no output
  4.    error
 Discuss Question
Answer: Option D. -> error
Question 24. What will be the output of the following PHP code ?$a = 10;$b = 11;if ($a < ++$a || $b < ++$b)print "hello";elseprint "hi";
  1.    error
  2.    hi
  3.    no output
  4.    hello
 Discuss Question
Answer: Option B. -> hi
Question 25. What will be the output of the following PHP code ?$x = 1;if ($x--)print "hi"$x--;elseprint "hello"
  1.    no output
  2.    hi
  3.    error
  4.    hello
 Discuss Question
Answer: Option C. -> error
Question 26. What will be the output of the following PHP code ?$a = "1";$b = "0";if ((int)$a && $b)print"hi";elseprint "hello";
  1.    hi
  2.    error
  3.    no output
  4.    hello
 Discuss Question
Answer: Option D. -> hello
Question 27. What will be the output of the following PHP code ?$a = 2;if ($a-- - --$a - $a)print "hello";elseprint "hi";
  1.    no output
  2.    hello
  3.    hi
  4.    error
 Discuss Question
Answer: Option B. -> hello
Question 28. What will be the output of the following PHP code ?$a = "hello";if (strlen($a))print strlen($a);elseprint "hi";
  1.    5
  2.    error
  3.    hi
  4.    hellolength
 Discuss Question
Answer: Option A. -> 5
Question 29. What will be the output of the following PHP code ?$a = "hello";if ($a.length)print $a.length;elseprint "hi";
  1.    error
  2.    hi
  3.    5
  4.    hellolength
 Discuss Question
Answer: Option D. -> hellolength
Question 30. What will be the output of the following PHP code ?$a = "1";switch ($a) {case 1:print "hi";case 2:print "hello";default:print "hi1";}
  1.    hi1
  2.    hi
  3.    hihellohi1
  4.    hihi1
 Discuss Question
Answer: Option C. -> hihellohi1

Latest Videos

Latest Test Papers