Question PSC-ARR-0035
EasyWhat does the following pseudocode print?
Integer a[] = {1, 2, 2, 3, 3, 3}, count = 0
for (each i from 1 to 5)
if (a[i] == a[i - 1])
count = count + 1
end if
end for
Print count
- A.
6
- B.
2
- C.
Sign up free to see the answer and a step-by-step explanation.