ProgrammingEasyTCS NQT · Infosys · Accenture

What will be the output of the following pseudocode?

What will be the output of the following pseudocode?
Integer p = 29, q = 6
Print (p mod q) + (p / q)
  1. A. 5
  2. B. 4
  3. C. 9
  4. D. 10

Correct answer: C. 9

29 mod 6 = 5 and 29 / 6 = 4 (integer division), so the sum is 9.

More Pseudocode and Code Tracing questions

Exams that ask this topic