int a = -1;
unsigned int b = 1;
if(a>b)
{
printf("%d>%d",a,b);
}
else if(b>a)
{
printf("%d>%d",b,a);
}
So the output of this program says -1 > 1. Am I right in saying that this happens because the (signed) int is converted to unsigned int?
How come it doesn't just converted both to long (signed) int?