adplus-dvertising

Welcome to the PHP Controls Structures MCQs Page

Dive deep into the fascinating world of PHP Controls Structures with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of PHP Controls Structures, a crucial aspect of PHP. In this section, you will encounter a diverse range of MCQs that cover various aspects of PHP Controls Structures, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within PHP.

frame-decoration

Check out the MCQs below to embark on an enriching journey through PHP Controls Structures. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of PHP.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of PHP Controls Structures. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

PHP Controls Structures MCQs | Page 8 of 11

Q71.
What will be the output of the following PHP code ?
<?php
$i = 0;
while(++$i || --$i)
{   
    print $i;
}
?><?php
$i = 0;
while (++$i && --$i)
{   
    print $i;
}
?>
Discuss
Answer: (c).no output
Q72.
What will be the output of the following PHP code ?
<?php
$i = 0;
while ((--$i > ++$i) - 1)
{   
    print $i;
}
?><?php
$i = 2;
while (++$i)
{   
    while ($i --> 0)
        print $i;
}
?>
Discuss
Answer: (a).210
Q73.
What will be the output of the following PHP code ?
<?php
$i = 2;
while (++$i)
{   
    while (--$i > 0)
        print $i;
}
?><?php
$i = 0;
for ($i)
{
    print $i;
}
?>
Discuss
Answer: (d).error
Q74.
What will be the output of the following PHP code ?
<?php
$colors = array("red","green","blue","yellow"); 
foreach ($colors as $value)
{
    echo "$value <br>";
}
?>
Discuss
Answer: (a).red
green
blue
Discuss
Answer: (a).The number is: 0
The number is: 1
The number is: 2
The number is: 3
The number is: 4
The number is: 5
The number is: 6
The number is: 7
The number is: 8
The number is: 9
The number is: 10
Q76.
What will be the output of the following PHP code ?
<?php
for ($x = 0; $x <= 10; print ++$x)
{
    print ++$x;
}
?>
Discuss
Answer: (a).123456789101112
Q77.
What will be the output of the following PHP code ?
<?php
for ($x = 1; $x < 10;++$x)
{
    print "*\t";
}
?>
Discuss
Answer: (b).*********
Q78.
What will be the output of the following PHP code ?
<?php
for ($x = -1; $x < 10;--$x)
{
    print $x;
}
?>
Discuss
Answer: (d).infinite loop
Q79.
What will be the output of the following PHP code ?
<?php
$x;
for ($x = -3; $x < -5; ++$x)
{
    print ++$x;
}
?>
Discuss
Answer: (d).no output
Q80.
What will be the output of the following PHP code ?
<?php
for ($i++; $i == 1; $i = 2)
    print "In for loop ";
print "After loop\n";
 
?>
Discuss
Answer: (c).In for loopAfter for loop

Suggested Topics

Are you eager to expand your knowledge beyond PHP? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!