Skip to main content

Java Topic Practice

While Loops

While Loops MCQ Practice

Question 1 of 15

Answered 0 of 15

Choose one answer.

What is printed by the following code segment?

int value = 18;
int count = 0;
while (value > 1) {
  value /= 2;
  count++;
}
System.out.print(count + ":" + value);
Choose one answer.