State the values of n and ch.
a) n = 98, ch = 'b'
b) n = 69, ch = 'B'
c) n = 66, ch = B
Attachments:
Answers
Answered by
0
Answer:
Value of n is 66 and ch is B.
int n = c + 1, here due to implicit conversion, 'A' will be converted to its ASCII value 65. 1 is added to it making the value of n 66.
char ch = (char)n, here through explicit conversion 66 is converted to its corresponding character that is 'B' so value of ch becomes B.
Similar questions