Question 371
int n = 100;
int count = 0;
while (n > 1)
{
n = n / 2;
count++;
}
System.out.println(count);Main Solution
Solution:
Correct: B. Trace of n: 100 → 50 → 25 → 12 → 6 → 3 → 1. The loop runs 6 times (the condition n>1 becomes false when n = 1).
Answer: Correct: B
Answer images

