+ 2
Why the inserted code give a pattern?
https://code.sololearn.com/csI3VZDfm2X4/?ref=app why the output is like a pattern?
2 Answers
+ 1
I have changed your code a little and it gives the same result
https://code.sololearn.com/cpJtrKaqaEUA/?ref=app
0
A variable of char type can hold only 1 byte of data. So when you are assigning a string to it only the last character of the string is retained. So
a = 'c' and b='z'
When you add them you are actually adding their ASCII values and thus you are assigning 99+122=221 to a. When c is printed the corresponding ASCII character is displayed.