Question PSC-ARR-0061
HardWhat will be printed by the following pseudocode?
Integer a[8] = {5, 2, 8, 2, 9, 1, 5, 5}
Integer i, j, uniq = 0
for (each i from 0 to 7)
Integer seen = 0
for (each j from 0 to i - 1)
if (a[j] == a[i]) seen = 1 end if
end for
if (seen == 0) uniq = uniq + 1 end if
end for
Print uniq
- A.
5
- B.
4
- C.
Sign up free to see the answer and a step-by-step explanation.