pencil-icon
Build your own quiz

Computers

9th -

12thgrade

Image

Loops

1.5K
plays

10 questions

Show Answers
See Preview
  • 1. Multiple Choice
    5 minutes
    1 pt
    How many times will the following code print "Welcome to Java"?
    int count = 0;
    while (count < 10) {
     System.out.println("Welcome to Java");
     count++;
    }
    8
    9
    10
    0
  • 2. Multiple Choice
    5 minutes
    1 pt
    What is the output of the following code?
    int x = 0;
    while (x < 4) {
     x = x + 1;
    }
    System.out.println("x is " + x);
    0
    1
    3
    4
  • 3. Multiple Choice
    5 minutes
    1 pt
     Analyze the following code.
    int count = 0;
    while (count < 100) {
     // Point A
     System.out.println("Welcome to Java!");
     count++;
     // Point B
    }
     // Point C
    count < 100 is always true at Point B 
     count < 100 is always false at Point B
     count < 100 is always true at Point A  and count < 100 is always false at Point C
     count < 100 is always true at Point Coint C
  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?