Consider the array given below:

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

1(ix)1 Mark · 2025 · Section A · 2025 Specimen

Consider the array given below:

char ch[] = {'A','E','I','O', 'U'};

Write the output of the following statements:

System.out.println(ch[0]*2);:
Show SolutionHide Solution↓

130

Reason — The given array is:

char ch[] = {'A', 'E', 'I', 'O', 'U'};

Step-by-Step Execution:

1. ch[0]:

  • The element at index 0 of the array is 'A'.

2. Character Multiplication in Java:

  • In Java, a char is treated as a numeric value based on its ASCII code when used in arithmetic operations.
  • The ASCII value of 'A' is 65.

3. ch[0] * 2:

  • Substituting ch[0] with its ASCII value:
65 * 2 = 130

4. Output:

  • System.out.println(ch[0] * 2); will print 130.
← Previous questionNext question →

Browse the free Computer Applications sample bank