Sail E0 Webinar

MCQs

Total Questions : 74 | Page 7 of 8 pages
Question 61. What will be the output of the following PHP code ?for ($count = 0; $count
  1.    hi
  2.    hihellohihellohihello
  3.    hihihi
  4.    hellohellohello
 Discuss Question
Answer: Option A. -> hi
Question 62. What will be the output of the following PHP code ?for ($i = 0; -5 ; $i++) {print"i";if ($i == 3)break;}
  1.    0 1 2 3
  2.    error
  3.    0 1 2 3 4 5
  4.    0 1 2 3 4
 Discuss Question
Answer: Option A. -> 0 1 2 3
Question 63. What will be the output of the following PHP code ?for(++$i; ++$i; ++$i) {print $i;if ($i == 4)break;}
  1.    134
  2.    24
  3.    1
  4.    1234
 Discuss Question
Answer: Option B. -> 24
Question 64. What will be the output of the following PHP code ?for ($i = 0;$i = -1;$i = 1) {print $i;if ($i != 1)break;}
  1.    infinite loop
  2.    0
  3.    1
  4.    -1
 Discuss Question
Answer: Option D. -> -1
Question 65. What will be the output of the following PHP code ?for(;;) {print "10";}
  1.    infinite loop
  2.    error
  3.    no output
  4.    10
 Discuss Question
Answer: Option A. -> infinite loop
Question 66. What will be the output of the following PHP code ?for ($i = 0; 0; $i++) {print"i";}
  1.    0
  2.    error
  3.    no output
  4.    infinite loop
 Discuss Question
Answer: Option C. -> no output
Question 67. What will be the output of the following PHP code ?$user = array("Ashley", "Bale", "Shrek", "Blank");for ($x = 0; $x < count($user); $x++) {if ($user[$x] == "Shrek")continue;printf ($user[$x]);}
  1.    AshleyBaleShrek
  2.    AshleyBale
  3.    AshleyBaleBlank
  4.    No output
 Discuss Question
Answer: Option C. -> AshleyBaleBlank
Question 68. What will be the output of the following PHP code ?$user = array("Ashley", "Bale", "Shrek", "Blank");for ($x=0; $x < count($user) - 1; $x++) {if ($user[$x++] == "Shrek")continue;printf ($user[$x]);}
  1.    Bale
  2.    AshleyBaleBlank
  3.    BaleBlank
  4.    AshleyShrek
 Discuss Question
Answer: Option B. -> AshleyBaleBlank
Question 69. What will be the output of the following PHP code ?for ($i = 0; $i < 5; $i++) {for ($j = $i; $j > 0; $i--)print $i;}
  1.    infinite loop
  2.    no output
  3.    0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 0 1 2 3 4 5
  4.    0 1 2 3 4 5
 Discuss Question
Answer: Option A. -> infinite loop
Question 70. What will be the output of the following PHP code ?for ($i = 0; $i < 5; $i++) {for ($j = $i;$j > $i; $i--)print $i;}
  1.    0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 0 1 2 3 4 5
  2.    no output
  3.    infinite loop
  4.    0 1 2 3 4 5
 Discuss Question
Answer: Option B. -> no output

Latest Videos

Latest Test Papers