I was reading some examples in how to convert char to int, and i have this code:
#include <stdio.h>
int main()
{
char ch1 = 125, ch2 = 10;
ch1 = ch1 + ch2;
printf("%d\n", ch1);
printf("%c\n", ch1 - ch2 - 4);
return 0;
}
as i know that if we made any Character arithmetic the char type will convert to int
so why the result of first printf statement is -121 not 135 as i know int range will handle 135 so no overflow will happened.
the second printf statement will print y because we put %c in the printf .