Question PSC-ARR-0006
EasyWhat will be the output of the following pseudocode?
Integer a[] = {5, 10, 15}
a[1] = a[0] + a[2]
Print a[1]
- A.
15
- B.
25
- C.
Show answer and explanation
Answer: C
a[1] is overwritten with a[0] + a[2] = 5 + 15 = 20.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Arrays question
What will be the output of the following pseudocode?
Integer a[] = {5, 10, 15}
a[1] = a[0] + a[2]
Print a[1]
15
25
Answer: C
a[1] is overwritten with a[0] + a[2] = 5 + 15 = 20.
20
10