Why do i get negative number when executing this?
unsigned int a = 1 << 31;
printf("%d",a);
I already checked size of integer on my computer and it is 4 Bytes. So my integer number is consisted of 32 bits and doing 31 shifts to the left I should get until the most significant bit. That means that it should be positive number, but i always get negative.
What I get : -2147483648
What I expected : Some positive number ( probably 1073741824)
What am I missing here?