Question PSC-COND-0023
EasyWhat is the output of this pseudocode?
Integer x = -4
if (x > 0)
Print "positive"
else if (x < 0)
Print "negative"
else
Print "zero"
end if
- A.
zero
- B.
positive
- C.
Show answer and explanation
Answer: D
x is −4, which is less than 0, so the second branch prints "negative".