Sail E0 Webinar

MCQs

Total Questions : 74 | Page 5 of 8 pages
Question 41. What will be the output of the following PHP code ?$i = 0;do {$i++;}while ($i < 3);print $i;
  1.    1
  2.    2
  3.    3
  4.    0
 Discuss Question
Answer: Option C. -> 3
Question 42. What will be the output of the following PHP code ?$i = 0;while ($i++) {print $i;}print $i;
  1.    01
  2.    1
  3.    infinite loop
  4.    0
 Discuss Question
Answer: Option B. -> 1
Question 43. What will be the output of the following PHP code ?$i = 0;while ($i < 3) {$i++;}print $i;
  1.    1
  2.    3
  3.    2
  4.    0
 Discuss Question
Answer: Option B. -> 3
Question 44. What will be the output of the following PHP code ?do {print "hi";}while(0);print "hello";
  1.    hello
  2.    error
  3.    infinite loop
  4.    hihello
 Discuss Question
Answer: Option D. -> hihello
Question 45. What will be the output of the following PHP code ?$i = "";while($i) {print "hi";}print "hello";
  1.    infinite loop
  2.    hihello
  3.    error
  4.    hello
 Discuss Question
Answer: Option D. -> hello
Question 46. What will be the output of the following PHP code ?$i = "";while ($i) {print "hi";}while($i < 8)$i++;print "hello";
  1.    Hi is printed 8 times, hello 7 times and then hi 2 times
  2.    Hi is printed once, hello 7 times and then hi 2 times
  3.    Hi is printed once, hello 7 times
  4.    Hi is printed 10 times, hello 7 times
 Discuss Question
Answer: Option B. -> Hi is printed once, hello 7 times and then hi 2 times
Question 47. What will be the output of the following PHP code ?for ($x = 0; $x
  1.    1234567891011
  2.    123456789101112
  3.    infinite loop
  4.    12345678910
 Discuss Question
Answer: Option B. -> 123456789101112
Question 48. What will be the output of the following PHP code ?$i = 0;while(?++$i || --$i) {print $i;}
  1.    1234567891011121314...infinitely
  2.    0
  3.    01234567891011121314...infinitely
  4.    1
 Discuss Question
Answer: Option A. -> 1234567891011121314...infinitely
Question 49. What will be the output of the following PHP code ?$i = 0;while($i = 10) {print "hi";}print "hello";
  1.    error
  2.    infinite loop
  3.    hihello
  4.    hello
 Discuss Question
Answer: Option B. -> infinite loop
Question 50. What will be the output of the following PHP code ?$i = 0;for ($i) {print $i;}
  1.    0
  2.    no output
  3.    infinite loop
  4.    error
 Discuss Question
Answer: Option D. -> error

Latest Videos

Latest Test Papers