Question PSC-LOOP-0069
HardWhat is the output of this pseudocode?
Integer n = 5, i, j
for (each i from 1 to n)
String line = ""
for (each j from 1 to n - i)
line = line + "."
end for
for (each j from 1 to 2 * i - 1)
line = line + "*"
end for
if (i == 3)
Print line
end if
end for
- A.
.*****
- B.
...***
- C.
Sign up free to see the answer and a step-by-step explanation.