MCQ Single Best Answer Easy

QSystem.out.println('Z'+32); will display:

ID: #24150 ICSE Computer Application - Class X - 2025 PYQ 144 views
Question Info
#24150Q ID
EasyDifficulty
ICSE Computer Application - Class X - 2025 PYQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A z
  • B Z
  • C 122
  • D 154
Correct Answer: Option D

Explanation

The correct answer is:

(d) 154

Explanation:

In the expression:


System.out.println('Z' + 32);

  1. The character 'Z' has an ASCII value of 90.

  2. The integer 32 is added to it:
    90 + 32 = 122.

  3. Since both 'Z' (char) and 32 (int) are involved in an arithmetic operation, 'Z' is promoted to an integer before addition.

  4. The result is 122, which is the ASCII value of 'z', but since no type casting is done, it prints the integer 122 instead of the character 'z'.

So, the correct answer should be (c) 122, not (d) 154. Please verify your answer choices.

Share This Question

Challenge a friend or share with your study group.