Question PSC-OPS-0007
EasyWhat will be the output of the following pseudocode?
Integer x = 7
x = x mod 4 + x / 4 // integer division
Print x
- A.
3
- B.
4
- C.
Show answer and explanation
Answer: B
7 mod 4 = 3 and 7 / 4 = 1, so x = 4.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operators and Expressions question
What will be the output of the following pseudocode?
Integer x = 7
x = x mod 4 + x / 4 // integer division
Print x
3
4
Answer: B
7 mod 4 = 3 and 7 / 4 = 1, so x = 4.
2
1