#include <stdio.h>
int main() {
unsigned int x = -1; // bit pattern = all ones
int y = ~0; // bit pattern = all ones
if (x == y) // y is promoted to unsigned int
// ( as common type) for comparison
printf("same"); // gets printed
else
printf("not same");
return 0;
}