What will be the output of the following pseudocode? SET x TO 5 SET y TO 5 IF…
2024
What will be the output of the following pseudocode?
SET x TO 5
SET y TO 5
IF x >= y THEN
OUTPUT "x is greater than or equal to y"
ELSE
OUTPUT "x is less than y"
END IF
- A.
x is greater than or equal to y
- B.
x is less than y
- C.
5
- D.
Error
Attempted by 166 students.
Show answer & explanation
Correct answer: A
Correct Answer: x is greater than or equal to y
Explanation:
x = 5
y = 5
Condition x >= y is true because 5 >= 5.
Therefore, it displays the message "x is greater than or equal to y" using the `OUTPUT` statement.