Question PSC-ARR-0077
HardWhat will be printed by the following pseudocode?
Integer a[7] = {1, 1, 2, 2, 2, 3, 3}
Integer i, w = 1
for (each i from 1 to 6)
if (a[i] != a[w - 1])
a[w] = a[i]
w = w + 1
end if
end for
Print w, a[w - 1]
- A.
7 3
- B.
4 3
- C.
Sign up free to see the answer and a step-by-step explanation.