The behavior of comparisons between signed and unsigned types involves type promotion and conversion rules in C. When a signed value is compared with an unsigned value, the signed value is converted to unsigned, which can lead to unexpected results. The %d format specifier prints the actual value for signed types, while for unsigned types, it represents their value as a positive integer.
If you meant to say that the output for d should be 4294967295, that would be correct. The output of printf("%d\n", d); should reflect the unsigned representation, which is not -1.