Sail E0 Webinar

MCQs

Total Questions : 74 | Page 6 of 8 pages
Question 51. What will be the output of the following PHP code ?for ($x =1; $x < 10;++$x) {print "*t";}
  1.    infinite loop
  2.    **********
  3.    *********
  4.    ***********
 Discuss Question
Answer: Option C. -> *********
Question 52. What will be the output of the following PHP code ?for ($x = -1; $x < 10;--$x) {print $x;}
  1.    infinite loop
  2.    12345678910
  3.    123456789101112
  4.    1234567891011
 Discuss Question
Answer: Option A. -> infinite loop
Question 53. What will be the output of the following PHP code ?for (1; $i == 1; $i = 2)print "In for loop ";print "After loopn";
  1.    In for loopAfter for loop
  2.    In for loop
  3.    Infinite loop
  4.    After for loop
 Discuss Question
Answer: Option D. -> After for loop
Question 54. What will be the output of the following PHP code ?for ($i++; $i == 1; $i = 2)print "In for loop ";print "After loop";
  1.    Infinite loop
  2.    After for loop
  3.    In for loopAfter for loop
  4.    In for loop
 Discuss Question
Answer: Option C. -> In for loopAfter for loop
Question 55. What will be the output of the following PHP code ?$x;for ($x = -3; $x < -5; ++$x) {print ++$x;}
  1.    -3-4
  2.    -3-4-5
  3.    no output
  4.    infinite loop
 Discuss Question
Answer: Option C. -> no output
Question 56. What will be the output of the following PHP code ?for ($i == 2; ++$i == $i; ++$i)print "In for loop ";print "After loop";
  1.    After for loop
  2.    After for loopAfter for loopAfter for loop...infinitely
  3.    In for loopAfter for loopIn for loopAfter for loopIn for loopAfter for loop...infinitely
  4.    In for loopIn for loopIn for loopIn for loop...infinitely
 Discuss Question
Answer: Option D. -> In for loopIn for loopIn for loopIn for loop...infinitely
Question 57. What will be the output of the following PHP code ?for ($x = 1; $x < 10; $x++)for ($y = 1; $y < 5; $y++)print "Hello";
  1.    Hello….36 times
  2.    Hello….40 times
  3.    Hello….50 times
  4.    Hello….45 times
 Discuss Question
Answer: Option A. -> Hello….36 times
Question 58. What will be the output of the following PHP code ?for ($count = 0; $count < 3;$count++); {print "hi";continue;print "hello";}
  1.    hi
  2.    hihihi
  3.    hellohellohello
  4.    hihellohihellohihello
 Discuss Question
Answer: Option B. -> hihihi
Question 59. What will be the output of the following PHP code ?for ($count = 1; $count != 20;$count++) {print $count;$count++;}
  1.    Infinite
  2.    1357…19
  3.    123…….20
  4.    13579…21
 Discuss Question
Answer: Option A. -> Infinite
Question 60. What will be the output of the following PHP code ?for ($count = 1; $count < 20; $count++);print $count;
  1.    19
  2.    12345678910….19
  3.    20
  4.    12345678910….1920
 Discuss Question
Answer: Option C. -> 20

Latest Videos

Latest Test Papers