pencil-icon
Build your own quiz

Computers

12th

grade

Image

Tracing Loops in Java

246
plays

17 questions

Show Answers
See Preview
  • 1. Multiple Choice
    3 minutes
    1 pt
    Image

    What are the values of var1 and var2 when the code finishes executing?

    var1 = 1, var2 = 1

    var1 = 2 , var2 = 0

    var1 = 3, var2 = -1

    var1 = 0, var2 = 2

    The loop will cause a run-time error for division by zero

  • 2. Multiple Choice
    3 minutes
    1 pt
    Image

    What are the values of x and y when the code finishes executing?

    x = 5, y = 2

    x = 2, y = 5

    x = 3, y = 4

    x = 4, y = 3

    Infinite Loop

  • 3. Multiple Choice
    3 minutes
    1 pt
    Image

    How many stars are printed?

    7

    3

    4

    5

    Infinite Loop

  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?