unsigned int b=0000000000010100 (assuming int = 2 bytes)
b=~b, therefore b=1111111111101011
now %d specifier does not know anything about signed or unsigned, it just assume that the given number is in signed 2's complement form..
and hence value returned will be -21...