[Solved] explain Format specifiers %f and gow does dot work in it [closed]


%d, %f are conversion specifier for printf and other function, this is not specific to the C language. Check man printf (and man scanf while you’re at it).

With printf: if you use a period before the conversion specifier, you are asking for a precision. With the %f conversion, it affects the length of the fractional part.

From man printf:

The precision

An optional precision, in the form of a period (‘.’) followed by an optional decimal digit string […]. If the precision is given as just ‘.’, or the precision is negative, the precision is taken to be zero. This gives the minimum number of digits to appear for d, i, o, u, x, and X conversions, the number of digits to appear after the radix character for a, A, e, E, f, and F conversions, the maximum number of significant digits for g and G conversions, or the maximum number of characters to be printed from a string for s and S conversions.

solved explain Format specifiers %f and gow does dot work in it [closed]