✏️ Explanatory Question
Write the value of n after execution:
char ch ='d'; int n = ch + 5;
Write the value of n after execution:
char ch ='d'; int n = ch + 5;
Answer
The value of n is 105.
char ch = 'd'; assigns the character 'd' to the variable ch. In ASCII, the character 'd' has a decimal value of 100.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.