placeholder image to represent content

Loops with Java

Quiz by Carol

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

Correct quiz answers unlock more play!

New Quizalize solo game modes
6 questions
Show answers
  • Q1
    Note: the println() function prints out a line of text with the value that you pass to it - so if you say println("Hi"), it will output: Hi Consider the following code: var i = 0; while (i < 3) { println("hi"); i++; } What does the code output?
    hi hi hi
    30s
  • Q2
    Consider the following code: var i = 0; while (i < 3) { println("hi"); i++; } println("bye"); What does the code output?
    hi hi hi bye
    30s
  • Q3
    Consider the following code: var i = 0; while (i < 0) { println("hi"); } What does the code output?
    no output
    30s
  • Q4
    Consider the following code: var x = 3; var i = 0; while (i < 3) { x += 1; i += 1; } println(x); What does the code output?
    6
    30s
  • Q5
    Consider the following code: var i = 3; while (i < 6) { println(i); i += 1; } What is the output?
    3 4 5
    30s
  • Q6
    Consider the following code: var i = 0; while (i < 3) { println(i); i++; } What does the code output?
    0 1 2
    30s

Teachers give this quiz to your class