Question PSC-ARR-0079
HardWhat does the following pseudocode print?
Integer a[5] = {2, 3, 1, 1, 4}
Integer i, far = 0, ok = 1
for (each i from 0 to 4)
if (i > far)
ok = 0
end if
if (i + a[i] > far)
far = i + a[i]
end if
end for
Print ok, far
- A.
0 8
- B.
1 5
- C.
1 4
- D.
1 8
Sign up free to see the answer and a step-by-step explanation.