State the values of n and ch. char c=‘A’; int n=c+1; char ch=(char)n;
Answers
Answered by
7
Answer:
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.
hope it's helpful for you ✌️✌️
drop some thanks plz...
Similar questions
Computer Science,
17 days ago
English,
17 days ago
Hindi,
1 month ago
English,
1 month ago
Hindi,
9 months ago