Question PSC-COND-0001
EasyWhat will be the output of the following pseudocode?
Integer a = 7, b = 4
if (a > b)
Print a - b
else
Print b - a
end if
- A.
11
- B.
4
- C.
Show answer and explanation
Answer: D
a > b is true, so a − b = 3 is printed.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Conditionals question
What will be the output of the following pseudocode?
Integer a = 7, b = 4
if (a > b)
Print a - b
else
Print b - a
end if
11
4
Answer: D
a > b is true, so a − b = 3 is printed.
-3
3