printf
printf
(library)The first argument is a format string which may containordinary characters which are just printed and "conversionspecifications" - sequences beginning with '%' such as %6dwhich describe how the other arguments should be printed, inthis case as a six-character decimal integer padded on theright with spaces.
Possible conversion specifications are d, i or u (decimalinteger), o (octal), x, X or p (hexadecimal), f(floating-point), e or E (mantissa and exponent,e.g. 1.23E-22), g or G (f or e format as appropriate to thevalue printed), c (a single character), s (a string), %(i.e. %% - print a % character). d, i, f, e, g are signed,the rest are unsigned.
The variant fprintf prints to a given output stream andsprintf stores what would be printed in a string variable.
Unix manual page: printf(3).