Consider the following array and answer the questions given below:

ICSE Class 10 Computer Applications PYQ · 2025 Paper · Section A

2(viii)1 Mark · 2025 · Section A · 2025 Paper

Consider the following array and answer the questions given below:

int a[] = {12, 10, 8, 4, 6, 2, 3, 5, 7};

(a) What is the output of System.out.print(a[0] + a[5]);?

(b) What is the index (subscript) of the largest element of the array a[]?

Show SolutionHide Solution↓

(a) 14

(b) The largest element in the array is 12, which is at index 0.

  • a[0] is 12.
  • a[5] is 2.
  • Sum = 12 + 2 = 14.
← Previous questionNext question →

Browse the free Computer Applications sample bank