I have an unsigned int variable x which value is comprised between from 0 and 0xFFFFF and I would like to print it in a way more readable for the user.
If x is greater than 0xF000, print it in hexadecimal, else print it in decimal.
So something like this would do it
if (x > 0xF000)
printf("%#x", x);
else
printf("%u", x)
But I would like to know if there is an handier and smarter way to handle this, like conditional formatting for output depending of their value.