given
int a = 1; (00000000000000000000000000000001),
int a = 1;
00000000000000000000000000000001
what I did is just
a=(a<<31)>>31;
" however it turns out to be -1"
-1
You use an unsigned int to do so for seeing only 32 bit values that are greater than 0:
unsigned int
0
unsigned int a = 1; a=(a<<31)>>31;