Question PSC-ARR-0050
MediumWhat is the output of this pseudocode?
Integer a[6] = {0, 1, 0, 1, 1, 0}
Integer i, z = 0
for (each i from 0 to 5)
if (a[i] == 0)
a[z] = 0
z = z + 1
end if
end for
for (each i from z to 5)
a[i] = 1
end for
Print a[0], a[2], a[3], a[5]
- A.
1 1 0 0
- B.
0 0 1 1
- C.
Sign up free to see the answer and a step-by-step explanation.