Write the value of n after execution:

char ch ='d';
int n = ch + 5;

Single Choice
Views 44

Answer:

Answer

The value of n is 105.

Explanation

  1. char ch = 'd'; assigns the character 'd' to the variable ch. In ASCII, the character 'd' has a decimal value of 100.
  2. int n = ch + 5; adds 5 to the ASCII value of 'd', which is 100. So, 100 + 5 equals 105.

Therefore, the value of n will be 105.

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.