in my opinion, this is for portability purposes...
unsigned types tend to have larger values than signed types
creators of java want to make sure whether on any platform you use java values have the same limit on primitives
You are obviously taking the bits of the signed number -5, which in 32 bits is 2^32 - 5. Since C isn't a type-safe language, it will take the same bit pattern as that and covert it to positive or negative numbers depending on whether you use the %u or %i flags to display it.Try that, remembering the scanf . . . %i will take 2147483647 (maximum value of int) for anything larger.