I encountered this unexpected output with the following code in which I was verifying the maximum values (represented in decimal form) of the unsigned forms of short and int
You need to use %u for the format specifier for an unsigned type.
%u
unsigned