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 9 of 11

Q81.
What will be the output of the following PHP code ?
<?php
for (1; $i == 1; $i = 2)
    print "In for loop ";
print "After loop\n";
?>
Discuss
Answer: (b).After for loop
Discuss
Answer: (a).In for loopIn for loopIn for loopIn for loop……infinitely
Q83.
What will be the output of the following PHP code ?
<?php
for ($x = 1; $x < 10; $x++)
    for ($y = 1; $y < 5; $y++)
        print "Hello";
?>
Discuss
Answer: (a).Hello….36 times
Q84.
What will be the output of the following PHP code ?
<?php
for ($count = 1; $count != 20;$count++)
{
    print $count;
    $count++;
}
?>
Discuss
Answer: (a).Infinite
Q85.
What will be the output of the following PHP code ?
<?php
for ($count = 1; $count < 20; $count++);
    print $count;
?>
Discuss
Answer: (a).20
Q86.
What will be the output of the following PHP code ?
<?php
for ($count = 0; $count < 3;$count++);
{
    print "hi";continue;print "hello";
}
?>
Discuss
Answer: (a).hihihi
Q87.
What will be the output of the following PHP code ?
<?php
for ($count = 0; $count<3;$count++);
{
    print "hi";break;print "hello";
}
?>
Discuss
Answer: (d).hi
Q88.
What will be the output of the following PHP code ?
<?php
for(++$i; ++$i; ++$i)
{
    print $i;
    if ($i == 4) 
        break;
}
?>
Discuss
Answer: (a).24
Q89.
What will be the output of the following PHP code ?
<?php
for ($i = 0;$i = -1;$i = 1)
{
    print $i;
    if ($i != 1) 
 break;
}
?>
Discuss
Answer: (c).-1
Q90.
What will be the output of the following PHP code ?
<?php
for(;;)
{
   print "10";
}
?>
Discuss
Answer: (b).infinite 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!