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

  1. A.

    x is greater than or equal to y

  2. B.

    x is less than y

  3. C.

    5

  4. 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.

Explore the full course: Accenture Preparation