Sail E0 Webinar

MCQs

Total Questions : 54 | Page 2 of 6 pages
Question 11. What will be the output of the following PHP code?$total = "25 students";$more = 10;$total = $total + $more;echo "$total";
  1.    25 students
  2.    Error
  3.    35 students
  4.    35
 Discuss Question
Answer: Option D. -> 35
Question 12. What will be the output of the following PHP code?$color = "maroon";$var = $color[2];echo "$var";
  1.    Error
  2.    $var
  3.    r
  4.    a
 Discuss Question
Answer: Option C. -> r
Question 13. What will be the output of the following code?$foo = 'Bob';$bar = &$foo;$bar = "My name is $bar";echo $bar;echo $foo;
  1.    Error
  2.    My name is BobMy name is Bob
  3.    My name is Bob Bob
  4.    My name is BobBob
 Discuss Question
Answer: Option B. -> My name is BobMy name is Bob
Question 14. What will be the output of the following PHP code?$score = 1234;$scoreboard = (array) $score;echo $scoreboard[0];
  1.    1234
  2.    Error
  3.    2
  4.    1
 Discuss Question
Answer: Option A. -> 1234
Question 15. Which of the following PHP statements will output Hello World on the screen?1. echo (“Hello World”);2. print (“Hello World”);3. printf (“Hello World”);4. sprintf (“Hello World”);
  1.    1, 2 and 3
  2.    1 and 2
  3.    1, 2 and 4
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> 1, 2 and 3
Question 16. What will be the output of the following code?function track() {static $count = 0;$count++;echo $count;}track();track();track();
  1.    011
  2.    111
  3.    123
  4.    000
 Discuss Question
Answer: Option C. -> 123
Question 17. What will be the output of the following PHP code?$a = 5;$b = 5;echo ($a === $b);
  1.    5 === 5
  2.    False
  3.    1
  4.    Error
 Discuss Question
Answer: Option C. -> 1
Question 18. Which of the below statements is equivalent to $add += $add ?
  1.    $add = $add +$add
  2.    $add = $add
  3.    $add = $add + $add + 1
  4.    $add = $add + 1
 Discuss Question
Answer: Option A. -> $add = $add +$add
Question 19. What will be the output of the following PHP code?$a = "clue";$a .= "get";echo "$a";
  1.    true
  2.    false
  3.    get
  4.    clueget
 Discuss Question
Answer: Option D. -> clueget
Question 20. Which statement will output $x on the screen?
  1.    echo “\$x”;
  2.    echo “/$x”;
  3.    echo “$x;”;
  4.    echo “$$x”;
 Discuss Question
Answer: Option A. -> echo “\$x”;

Latest Videos

Latest Test Papers