Programming Language › PHP Basic MCQ › Question #2354
Single Choice Not Set

QWhat will be the output of the following php code?
< ?php 
$num  = "1";
$num1 = "2";
print $num+$num1 ;
?>

ID: #2354 PHP Basic MCQ 1,268 views
Question Info
#2354Q ID
Not SetDifficulty
PHP Basic MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 3 ✔ ✖
  • B 1+2 ✔ ✖
  • C Error ✔ ✖
  • D 12 ✔ ✖
Correct Answer

Explanation

The numbers inside the double quotes are considered as integers and not string, therefore the value 3 is printed and not 1+2.
Today: 0 answered · 0 correct
Save progress
Free account

Want to remember what you got wrong?

Create a free account in seconds to track your score, revisit mistakes and continue Programming Language where you left off.

  • Save your progress & streak
  • Topic-wise quizzes & scores
  • Bookmark tricky questions
  • Printable MCQ sets
Practice smarterFree account · save progress
Sign up free

Share This Question

Challenge a friend or share with your study group.