MCQ Practice Single Best Answer Topic: Variables in Php MCQ

Q What will be the output of the following PHP code?
< ?php 
$hello = "Hello World";
$bye = "Bye";
echo $hello;"$bye";
?>

Question ID
#2373
Subchapter
Variables in Php MCQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A Hello World
  • B Bye
  • C Hello worldBye
  • D Error
Correct Answer: A

Explanation

Since there is a semi-colon in between $hello and $bye, the line ends at $hello. However $bye would have printed if a echo was present before “$bye”.

Share This Question

Share this MCQ with your friends or study group.