#include<stdio.h>
int main()
{
char c = 125;
c = c+10;
printf("%d", c);
return 0;
}
Can any one please tell me why the output of the program is -121. In advance thank you
#include<stdio.h>
int main()
{
char c = 125;
c = c+10;
printf("%d", c);
return 0;
}
Can any one please tell me why the output of the program is -121. In advance thank you
It happens because of integer overflow. Max char value is 127, the result of sum is 135 which is more