What is output by this algorithm?
N ← 13
Count ← 0
WHILE N > 1 DO
N ← DIV(N, 2)
Count ← Count + 1
ENDWHILE
OUTPUT Count
- Start: N = 13, Count = 0. 13 > 1 is true, so N = DIV(13, 2) = 6 and Count = 1.
- 6 > 1 is true, so N = DIV(6, 2) = 3 and Count = 2.
- 3 > 1 is true, so N = DIV(3, 2) = 1 and Count = 3.
- 1 > 1 is false, so the loop stops.
Answer: The output is 3.