I have this code here where i multiply char type and int type variables and store them in different int variables
int m,n;
int num = 1000;
char c = 50;
m = num*c*c;
n = c*c*num;
printf("%d\n", m);
printf("%d\n", n);
and it outputs
2500000
2500000
I expected the output values to overflow, but it outputed the correct result.Why didn't it overflow?