The %d specifier prints a signed int. If you want to print an unsigned value, use %u.
Also, you'd be better off using INT_MIN, INT_MAX, and UINT_MAX from limits.h. That'll protect you from the off-by-one trap that you fell into with 4294967296.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
It would be in limits.h if there are any.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
It would be in limits.h if there are any.
Actually, there's a separate float.h for that information because there's more to it than just min/max (such as the radix and epsilon values).
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Um, are the names not obvious?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401