placeholder image to represent content

Chapter 7 Looping Structure

Quiz by Jayalakshmi Rajasekaran

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
15 questions
Show answers
  • Q1
    1. The _____construct provides an easy way to iterate over arrays
    do..while
    for
    foreach
    while
    30s
  • Q2
    2. Which of the following is an exit check loop?
    while
    for
    foreach
    do..while
    30s
  • Q3
    3. Which of the following is an entry check loop?
    All the above
    foreach
    while
    for
    30s
  • Q4
    4. What will be displayed in a browser when the following PHP code is executed:<?php for ($i=1;$i<=5; $i++) { echo “$i”; } ?>
    None of the above
    123
    12345
    1234
    30s
  • Q5
    5. What will be displayed in a browser when the following PHP code is executed: <?php for ($counter = 100; $counter < 10;$counter++) { echo “Welcome to Tamilnadu “; } echo “Counter is: $counter”; ?>
    Counter is : 100
    Welcome to Tamilnadu
    Welcome to Tamilnadu counter is: 100
    Infinite loop
    30s
  • Q6
    6. Which loop evaluates condition expression as Boolean, if it is true, it executes ­statements and when it is false it will terminate?
    while
    foreach
    for
    All of them
    30s
  • Q7
    7. PHP supports ____ types of looping techniques?
    3
    2
    5
    4
    30s
  • Q8
    8. How many main parameter are used in for loop?
    4
    2
    3
    1
    30s
  • Q9
    9. What will be the output of the following PHP code? <?php for ($num = 1; $num <= 10; $num += 2) { echo "$num "; } ?>
    1 2 3 4 5
    Error
    1 3 5 7 9
    9 7 5 3 1
    30s
  • Q10
    10. The most complicated looping structure is _________
    for
    do..while
    while
    None of them
    30s
  • Q11
    11. What will be the output of the following PHP code?<?php $i = 0 do { $i++; } while ($i < 3); print $i; ?>
    3
    2
    0
    1
    30s
  • Q12
    12. What will be the output of the following PHP code?<?php for ($x = 0; $x <= 10; print ++$x) { print ++$x; } ?>
    infinite loop
    12345678910
    123456789101112
    1234567891011
    30s
  • Q13
    13. in the following program identify the control variable for ($x = 0; $x <= 10; print ++$x) { print ++$x; } ?>
    $x
    $y
    print
    for
    30s
  • Q14
    14. ________ loop executes the block of code while the specified condition is true
    do...while
    foreach
    while & for
    for
    30s
  • Q15
    15. _________structure is useful for writing iteration logics
    Looping
    Variable
    Control
    datatypes
    30s

Teachers give this quiz to your class