PHP Controls Structures Mcqs
Our collections of Multiple choice questions and answers focuses on study of PHP Controls Structures. These questions are chosen from a collection of most authoritative and best reference books on PHP Language. Our aim is to prepare an individual for competitive exams like NTS, GAT, ECAT, University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate PHP Controls Structures Topics comprehensively.
PHP Programming Mcqs
- Basics of PHP Mcqs
- PHP Arrays and Functions Mcqs
- PHP Constants and Operators Mcqs
- PHP Controls Structures Mcqs
- PHP Error and Exception Handling Mcqs
- PHP Filesystem Mcqs
- PHP Functions Mcqs
- PHP Objects Tools and Variables Mcqs
- PHP OOP Mcqs
- PHP Session Handling Mcqs
- Strings and Regular Expressions Mcqs
Computer MCQS
Sciences MCQS
2.
Two broad types of control structures is branching and
Looping
Coding
Structuring
None of them
3.
Two main structures of branching are
If and switch
If and Do while
If and for
None of them
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
4.
Which of following operations are supported by PHP?
AND
OR, Exclusive OR
Not
All of them
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
5.
Loops that iterate for fixed number of times is called
Unbounded loops
Bounded loops
While loops
For loops
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
6.
Which loop evaluates condition expression as Boolean, if it is true, it executes statements and when it is false it will terminate?
For loop
For each loop
While loop
All of them
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
7.
Basic syntax for calling a function is
Function_name (experssion1, expersion2)
(experssion1 : Function_name, expersion2 : Function_name)
(experssion1, expersion2)
None of them
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
8.
What will be the output of the following PHP code?
<?php
$x;
if ($x)
print "hi" ;
else
print "how are u";
?>
<?php
$x;
if ($x)
print "hi" ;
else
print "how are u";
?>
How are u
Hi
Error
No output
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
9.
What will be the output of the following PHP code ?
<?php
$x = 0;
if ($x++)
print "hi";
else
print "how are u";
?>
<?php
$x = 0;
if ($x++)
print "hi";
else
print "how are u";
?>
Hi
No output
Error
How are u
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
10.
What will be the output of the following PHP code ?
<?php
$x;
if ($x == 0)
print "hi" ;
else
print "how are u";
print "hello"
?>
<?php
$x;
if ($x == 0)
print "hi" ;
else
print "how are u";
print "hello"
?>
How are uhello
Hihello
Hi
No output
11.
What will be the output of the following PHP code ?
<?php
$x = 0;
if ($x == 1)
if ($x >= 0)
print "true";
else
print "false";
?>
<?php
$x = 0;
if ($x == 1)
if ($x >= 0)
print "true";
else
print "false";
?>
True
False
Error
No output
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
12.
What will be the output of the following PHP code ?
<?php
$a = 1;
if ($a--)
print "True";
if ($a++)
print "False";
?>
<?php
$a = 1;
if ($a--)
print "True";
if ($a++)
print "False";
?>
True
False
Error
No output
13.
What will be the output of the following PHP code ?
True
False
Error
No output
14.
What will be the output of the following PHP code ?
<?php
$a = 1;
if (print $a)
print "True";
else
print "False";
?>
<?php
$a = 1;
if (print $a)
print "True";
else
print "False";
?>
True
False
Error
No output
15.
What will be the output of the following PHP code ?
<?php
$a = 10;
if (1)
print "all";
else
print "some"
else
print "none";
?>
<?php
$a = 10;
if (1)
print "all";
else
print "some"
else
print "none";
?>
All
Some
Error
None