Sail E0 Webinar

MCQs

Total Questions : 54 | Page 3 of 6 pages
Question 21. Which of the conditional statements is/are supported by PHP?1. if statements2. if-else statements3. if-elseif statements4. switch statements
  1.    1, 2 and 4
  2.    Only 1
  3.    All of the mentioned.
  4.    2, 3 and 4
 Discuss Question
Answer: Option C. -> All of the mentioned.
Question 22. Which of the below symbols is a newline character?
  1.    \r
  2.    /r
  3.    /n
  4.    \n
 Discuss Question
Answer: Option D. -> \n
Question 23. What will be the output of the following PHP code?$num = 10;echo 'What is her age? \n She is $num years old';
  1.    What is her age? n She is $num years old
  2.    What is her age?n She is 10 years old
  3.    What is her age? She is $num years old
  4.    What is her age? She is 10 years old
 Discuss Question
Answer: Option A. -> What is her age? n She is $num years old
Question 24. Which of the looping statements is/are supported by PHP?1. for loop2. while loop3. do-while loop4. foreach loop
  1.    All of the mentioned
  2.    1, 2 and 3
  3.    None of the mentioned
  4.    1 and 2
 Discuss Question
Answer: Option A. -> All of the mentioned
Question 25. What will be the output of the following PHP code?$team = "arsenal";switch ($team) {case "manu":echo "I love man u";case "arsenal":echo "I love arsenal";case "manc":echo "I love manc"; }
  1.    I love arsenalI love mancI love manu
  2.    I love arsenal
  3.    I love arsenalI love manc
  4.    Error
 Discuss Question
Answer: Option C. -> I love arsenalI love manc
Question 26. 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.    ShrekBlank
  2.    AshleyBale
  3.    Shrek
  4.    AshleyBaleBlank
 Discuss Question
Answer: Option D. -> AshleyBaleBlank
Question 27. What is the value of $a and $b after the function call?function doSomething( &$arg ) {$return = $arg;$arg += 1;return $return;}$a = 3;$b = doSomething( $a );
  1.    a is 3 and b is 4
  2.    a is 4 and b is 3
  3.    Both are 4
  4.    Both are 3
 Discuss Question
Answer: Option B. -> a is 4 and b is 3
Question 28. How does the identity operator === compare two values?
  1.    It returns True only if they are both of the same type and value
  2.    If the two values are strings, it performs a lexical comparison
  3.    It converts them to a common compatible data type and then compares the resulting values
  4.    It converts both values to strings and compares them
  5.    It bases its comparison on the C strcmp function exclusively
 Discuss Question
Answer: Option C. -> It converts them to a common compatible data type and then compares the resulting values
Question 29. If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?
  1.    Error
  2.    5
  3.    12
  4.    1
 Discuss Question
Answer: Option B. -> 5
Question 30. Who is the father of PHP?
  1.    Rasmus Lerdorf
  2.    List Barely
  3.    Drek Kolkevi
  4.    Willam Makepiece
 Discuss Question
Answer: Option A. -> Rasmus Lerdorf

Latest Videos

Latest Test Papers