The use of %% to designate a literal % in printf is not
a recent convention. It was defined in K&R, first edition.
If the character after the % is not a conversion character, that character is printed: thus % may be printed by %%.
Doug
Ralph Cordery wrote:
Though that may seem odd to our modern C-standardised eyes, it's
understandable in that if it isn't a valid %f, etc., format specifier
then it's a literal percent sign.