Question PSC-OPS-0005
EasyWhat will be the output of the following pseudocode?
Integer x = 10
x = x + 5
x = x * 2
Print x
- A.
15
- B.
20
- C.
Show answer and explanation
Answer: D
Statements run in order: x = 10 + 5 = 15, then x = 15 × 2 = 30.
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 = 10
x = x + 5
x = x * 2
Print x
15
20
Answer: D
Statements run in order: x = 10 + 5 = 15, then x = 15 × 2 = 30.
25
30