int main()
{
if(sizeof(double) > -1)
printf("M");
else
printf("m");
return 0;
}
I expected the output to be M but it is m. Can anybody please explain me the reason for the output?
int main()
{
if(sizeof(double) > -1)
printf("M");
else
printf("m");
return 0;
}
I expected the output to be M but it is m. Can anybody please explain me the reason for the output?
That's because sizeof
returns a size_t
value, that is, a unsigned integer type, so, -1 will overflow.