ProgrammingHardTCS NQT · Infosys · Accenture

What will be the output of the following pseudocode?

What will be the output of the following pseudocode?
Integer r
r = (12 AND 10) OR (5 XOR 3)
Print r
  1. A. 8
  2. B. 6
  3. C. 14
  4. D. 15

Correct answer: C. 14

12 AND 10 = 1100 AND 1010 = 1000 (8); 5 XOR 3 = 101 XOR 011 = 110 (6); 8 OR 6 = 1110 = 14.

More Pseudocode and Code Tracing questions

Exams that ask this topic