Below code is for Binary Representation of a Number.
This code works fine.....but i don't know why
if((x&(0x80000000))>0) should be <0 instead of >0
because if first bit of x is 1, number generated would be -2147483748 which is less than 0 but still this code works....
Was as confused as you were also, so I went ahead and printed the values of x and the value of the & condition. Turns out the value of the condition results in an unsigned value therefore checking for < 0; would not have produced desired results