Pseudo-code · Question 16 · Easy

What will be the output of the following pseudocode? (Note: / denotes integer division.)

Integer a, b
Set a = 10, b = 3
Print (a mod b) + (a / b)
  1. 13
  2. 4
  3. 7
  4. 3
Answer and explanation

Answer: B. 4

Explanation: 10 mod 3 is 1 and 10 / 3 with integer division is 3, so the sum is 4.

Previous: What will be the output of the following pseudocode? (Note: array indices… · Next: What will be the output of the following pseudocode? (Note: for-loop bounds…

Practise pseudo-code

Try a fresh set of pseudo-code questions with an explanation after every answer, free and without signing up: Pseudo-code practice. Or sit a full placement mock test.

More pseudo-code questions

More technical & programming practice

C Programming · Java · Python · Data Structures · Algorithms · Object-Oriented Programming · DBMS · SQL

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge