#include
int main()
{
float x;
x=(int)(float)(double)(5.5);
printf(\"%#u\",x);
return 0;
}
How the #
flag in the p
From c11 standard.
7.21.6.1. p6:
#:
The result is converted to an ‘‘alternative form’’. For o conversion, it increases the precision, if and only if necessary, to force the first digit of the result to be a zero (if the value and precision are both 0, a single 0 is printed). For x (or X) conversion, a nonzero result has 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g, and G conversions, the result of converting a floating-point number always contains a decimal-point character, even if no digits follow it. (Normally, a decimal-point character appears in the result of these conversions only if a digit follows it.) For g and G conversions, trailing zeros are not removed from the result. For other conversions, the behavior is undefined.
So, to clarify, using #
with u
is undefined.