printf("\%");
will print %
if you compile it in C89 mode (in K&R C, it is behavior defined).
In C99/11 this is not valid.
C11: 6.4.4.4 Character constants:
The double-quote
"
and question-mark?
are representable either by themselves or by the escape sequences\"
and\?
, respectively, but the single-quote'
and the backslash\
shall be represented, respectively, by the escape sequences\'
and\\
.
confirms that there is no escape sequence like \%
.
The preferred way is
printf("%%");
Almost similar question is answered here .