placeholder image to represent content

While Loop

Quiz by Rowell Marquina

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

Correct quiz answers unlock more play!

New Quizalize solo game modes
10 questions
Show answers
  • Q1

    Which of these statements is categorized as an initialization in a loop?

    counter++;

    counter--;

    while(counter<5)

    counter = 0;

    60s
  • Q2

    counter++ is equivalent to the formula counter = counter + 1.

    true
    false
    True or False
    60s
  • Q3

    Which of these conditions is capable of displaying "I love MITIS!" 5 times if the counter is initialize at zero (counter=0)?

    while (counter>4)

    while (counter<6)

    while (counter<5)

    while (counter>5)

    60s
  • Q4

    How many times will this loop run?

    counter =15;

    while (counter>0)

    {

    System.out.println("I love MITIS!");

    counter++;

    }

    It will  display "I love MITIS!" 16 times.

    It will  display "I love MITIS!" infinitely.

    It will not display "I love MITIS!" even once.

    It will  display "I love MITIS!" 15 times.

    120s
  • Q5

    If the condition is set at while(counter<4) and the counter is an incremental one, counter++, what number do I have to assign for the initial value of the counter to ensure that it will only run 2 times?

    counter = 1

    counter = 4

    counter = 2

    counter = 0

    120s
  • Q6

    Which of these conditions will display "I love MITIS!" 5 times if the initial value of the counter=10 and the counter is set at counter--?

    while (counter>=5)

    while (counter<5)

     while (counter<=5)

    while (counter>5)

    120s
  • Q7

    A counter++ type of counter is needed to ensure that "I love MITIS!" will be displayed 5 times if the condition is set at while(counter>5) and the initial value for counter is counter = 10;

    false
    true
    True or False
    120s
  • Q8

    Which of these statements is considered as the counter of the loop?

    while(counter>5)

    counter=0;

    counter++;

    120s
  • Q9

    This loop will run infinitely:

    int counter=10;

    while (counter>5)

    {

    System.out.println("I love MITIS!");

    counter++;

    }

    true
    false
    True or False
    120s
  • Q10

    When will the statement "END OF LOOP" be displayed on the screen using this WHILE LOOP?

    int counter=0;

    while (counter>5)

    {

    System.out.println("I love MITIS!");

    counter++;

    }

    System.out.println("END OF LOOP"); }

    Immediately, the statement "END OF LOOP" will be the only one shown on the screen.

    Never, because the loop will run infinitely.

    After displaying "I love MITIS" 4 times, 

    After displaying "I love MITIS" 5 times, 

    120s

Teachers give this quiz to your class