All India Exams
  • Sign In / Register Sign In
Home AptitudeBankEngineeringEnglishGKInterviewOnline TestPlacement PapersReasoning
  • Home
  • Aptitude
  • Bank
  • Engineering
  • English
  • GK
  • Interview
  • Online Test
  • Placement Papers
  • Reasoning

Variables Questions And Answers

Here you can find Variables Questions and Answers.

Why Variables Questions and Answers Required?

In this Variables Questions and Answers section you can learn and practice Variables Questions and Answers to improve your skills in order to face technical inerview conducted by organisations. By Practicing these interview questions, you can easily crack any Exams interview.

Where can I get Variables Questions and Answers?

AllIndiaExams provides you lots Variables Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download Variables Questions and Answers as PDF files and eBooks.

How to solve these Variables Questions and Answers?

You no need to worry, we have given lots of Variables Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Competitive Exams interview.

Variables Questions & Answers

1. What will be the output of the following PHP code ? < ?php one = 1; two = 2; three = 3; four = 4; echo "one / two + three / four"; ?>

Variables Questions & Answers

2. What will be the output of the following PHP code ? < ?php $on$e = 1; $tw$o = 2; $thre$e = 3; $fou$r = 4; echo "$on$e / $tw$o + $thre$e / $fou$r" ; ?>

Variables Questions & Answers

3. What will be the output of the following PHP code ? < ?php $on_e = 1; $tw_o = 2; $thre_e = 3; $fou_r = 4; echo "$on_e / $tw_o + $thre_e / $fou_r" ; ?>

Variables Questions & Answers

4. What will be the output of the following PHP code ? < ?php $On_e = 1; $tw_o = 2; $thre_e = 3; $fou_r = 4; echo "$on_e / $tw_o + $thre_e / $fou_r"; ?>

Variables Questions & Answers

What will be the output of the following PHP code ? < ?php echo $red ; ?>

Variables Questions & Answers

6. What will be the output of the following PHP code ? < ?php echo "$four4 + $three3 / $two2 - 1"; ?>

Variables Questions & Answers

7. What will be the output of the following PHP code ? < ?php $4four = 4; $3three = 3; $2two = 2; echo "$4four + $3three / $2two - 1"; ?>

Variables Questions & Answers

8. What will be the output of the following PHP code ? < ?php int $one = 1; echo "$one"; ?>

Variables Questions & Answers

9. What will be the output of the following PHP code ? < ?php var $one = 1; var $two = 2; echo "$one / $two * $one / $two * $two"; ?>

Variables Questions & Answers

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

Home EngineeringComputer Science & EngineeringPHP Questions and AnswersVariables

Variables - PHP Questions and Answers

This is the questions and answers section on " PHP Variables" with explanation for various interview, competitive examination and entrance test. Solved examples with detailed answer description, explanation are given and it would be easy to understand. For all the applicants this is the useful resource to check the questions in the PHP Variables Quiz. This article provides the top PHP Variables Questions asked in the various examinations and interviews. The contenders who are very interested to know about the Variables in PHP can refer to this post. We have arranged the multiple choice questions related to the Variables in the below PHP Variables Online Test. Therefore, all the competitors need to learn the variables topic by using the questions provided in this post. Along with the answers, the contenders can also find the explanation to the PHP Variables Questions.



PHP Variables Questions - PHP Variables Quiz Details

Online Test Name PHP VariablesFunctions
Exam Type Multiple Choice Questions
Category Computer Science Engineering Quiz
Number of Questions 10


All variables in PHP are denoted with a dollar sign ($). Variables in PHP can but do not need, to be declared before assignment. Variables are assigned with the (=) operator, with the variable on the left-hand side and the expression to be evaluated on the right-hand side. Likewise, there are some rules to declare a variable in PHP. So, the candidates need to know all the rules by practicing the PHP Variables Questions. From the above tabular format, the students can find the information about the PHP Variables Quiz. Based on the data given in it the aspirants can participate in the PHP Variables Online Test.



PHP Variables Multiple Choice Questions

Contenders can check the multiple choice questions related to the PHP Variables with the help of this article. The arranged PHP Variables Questions are repeated in the previous examinations and interviews. Thus, the candidates need to refer to the below PHP Variables Online Tets and gather the questions along with the answers. In addition to this, the students can find the topmost interviews questions that may be asked in the below PHP Variables Quiz. Without any delay, the competitors need to scroll down the page and take part in the PHP Variables Mock Test.

PHP Variables MCQ Quiz Answers with Solutions

Along with the answers, we have also provided the explanation to all the PHP Variables Multiple Choice Questions. So, the candidates can check and know why it is the correct option among the given options. Are you searching and waiting to practice more quizzes and online tests? Then check our web portal @ Allindiaexams.in to participate in the mock tests. For the sake of contenders, we have arranged all the subjects online tests and quizzes on our homepage.


1. What will be the output of the following PHP code ?
< ?php 
one = 1;
two = 2;
three = 3;
four = 4;
echo "one / two + three / four";
?>
  • A. 0.75
  • B. 0.25
  • C. 1.25
  • D. Error
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option D

Explanation:

Variables should start with a $ symbol, since one, two, three, four don't begin with $ symbol we will get an error.

Workspace

Report Error


2. What will be the output of the following PHP code ?
< ?php 
$on$e = 1;
$tw$o = 2;
$thre$e = 3;
$fou$r = 4;
echo "$on$e / $tw$o + $thre$e / $fou$r" ; 
?> 
  • A. 0.75
  • B. 0.05
  • C. 1.25
  • D. Error
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option D

Explanation:

You can not use the $ in between the variable name.

Workspace

Report Error


3. What will be the output of the following PHP code ?
< ?php 
$on_e = 1;
$tw_o = 2;
$thre_e = 3;
$fou_r = 4;
echo "$on_e / $tw_o + $thre_e / $fou_r" ; 
?>
  • A. 0.75
  • B. 0.05
  • C. 1.25
  • D. Error
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option C

Explanation:

You can use _ in a variable name.

Workspace

Report Error


4. What will be the output of the following PHP code ?
< ?php 
$On_e = 1;
$tw_o = 2;
$thre_e = 3;
$fou_r = 4;
echo "$on_e / $tw_o + $thre_e / $fou_r";
?>
  • A. 0.75
  • B. 0.05
  • C. 1.25
  • D. Error
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option A

Explanation:

Since the variable initialised is $On_e and the variable in the echo statement is $on_e the echo statement treats $on_e as 0;

Workspace

Report Error


5. What will be the output of the following PHP code ?
< ?php 
echo $red ;
?>
  • A. 0
  • B. Nothing
  • C. True
  • D. Error
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option B

Explanation:

There will no output returned as the variable $red does not hold any value.

Workspace

Report Error


  • «
  • 1
  • 2
  • »

Related Topics:

  • PHP Basics
  • MySQL Basics
  • Arrays
  • Functions
  • Strings & Regular Expressions
  • HTML Forms
  • Exception Handling
  • Object Oriented PHP

Mock Tests & Online Quizzes

  • Aptitude Online Test

  • Reasoning Online Test

  • GK Online Test

  • English Online Test

  • RRB Mock Test

  • RBI Mock Test

  • Free SBI Mock Test

  • IBPS Mock Test FREE

  • SSC Mock Test

  • CAT Exam Mock Test

  • GATE Mock Test

  • LIC Mock Test Series

  • MAT Mock Test

  • SEBI Mock Test

  • ESIC Mock Test

  • IT Courses Quiz

Newsletter

Contact Us

Questions and Answers

  • Aptitude Questions
  • Verbal Reasoning Questions
  • Non Verbal Reasoning Questions
  • Logical Reasoning Questions
  • Data Sufficiency Questions
  • Data Interpretation Questions
  • C Programming
  • C++ Programming
  • PHP Programming
  • Java Programming
  • eLitmus Sample Papers
  • ECE Questions and Answers
  • EEE Questions and Answers
  • Verbal Ability Questions
  • GK Questions
  • AMCAT Mock Online Test
  • LIC Mock Test
  • IBPS Mock Test

Interview Questions

  • Java Interview Questions
  • .Net Interview Questions
  • Networking Interview Questions
  • C Language Interview Questions
  • C++ Interview Questions
  • Testing Interview Questions
  • Android Interview Questions
  • HR Interview Questions
  • Group Discussion Topics
  • iOS Interview Questions
  • Web Technologies
  • Database Interview Questions
  • MS Office Interview Questions
  • Software Tools
  • Data Interpretation
  • PHP Interview Questions
  • CAT Mock Test
  • SSC Mock Test
© by AllIndiaExams.in. All Rights Reserved | Copyright | Terms of Use & Privacy Policy