Sail E0 Webinar

MCQs

Total Questions : 121 | Page 3 of 13 pages
Question 21. What will be the output of the following PHP code ?echo "This is India";
  1.    This is
  2.    This is India
  3.    This is India
  4.    Error
 Discuss Question
Answer: Option B. -> This is India
Question 22. What will be the output of the following PHP code ?$cars = array("Volvo", "BMW", "Toyota");echo "My car is a {$cars[0]}";
  1.    My car is a BMW
  2.    Error
  3.    My car is a Volvo
  4.    My car is a Toyota
 Discuss Question
Answer: Option C. -> My car is a Volvo
Question 23. What will be the output of the following PHP code ?$one = 1;print($one);print $one;
  1.    10
  2.    11
  3.    01
  4.    Error
 Discuss Question
Answer: Option B. -> 11
Question 24. What will be the output of the following PHP code ?$cars = array("Volvo", "BMW", "Toyota");print $cars[2];
  1.    Error
  2.    Volvo
  3.    Toyota
  4.    BMW
 Discuss Question
Answer: Option C. -> Toyota
Question 25. What will be the output of the following PHP code ?print "echo hello world";
  1.    error
  2.    echo hello world
  3.    hello world
  4.    nothing
 Discuss Question
Answer: Option B. -> echo hello world
Question 26. What will be the output of the following PHP code ?$one = "one";$two = "two";print($one$two);
  1.    one
  2.    error
  3.    onetwo
  4.    nothing
 Discuss Question
Answer: Option B. -> error
Question 27. What will be the output of the following PHP code ?print("this"."was"."a"."bad"."idea");
  1.    thiswasabadidea
  2.    this was a bad idea
  3.    error
  4.    nothing
 Discuss Question
Answer: Option A. -> thiswasabadidea
Question 28. What will be the output of the following PHP code ?$one = "one";$two = "one";print($one == $two);
  1.    error
  2.    false
  3.    true
  4.    1
 Discuss Question
Answer: Option D. -> 1
Question 29. What will be the output of the following PHP code ?class Constants{define('MIN_VALUE', '0.0');define('MAX_VALUE', '1.0');public static function getMinValue() {return self::MIN_VALUE;}public static function getMaxValue() {return self::MAX_VALUE;}}echo Constants::getMinValue();echo Constants::getMaxValue();
  1.    No output
  2.    0.01.0
  3.    01
  4.    ERROR
 Discuss Question
Answer: Option D. -> ERROR
Question 30. What will be the output of the following PHP code ?define("GREETING", "PHP is a scripting language");echo $GREETING;
  1.    PHP is a scripting language
  2.    GREETING
  3.    $GREETING
  4.    no output
 Discuss Question
Answer: Option D. -> no output

Latest Videos

Latest Test Papers