Reputation: 5325
I want to print like %d
in C but it's showing some number.
Upvotes: 1
Views: 11756
Reputation: 455440
To get a %
you need to have %%
.
printf("%%d");
prints
%d
The printf
man page says:
conversion
specifier
% A '%' is written. No argument is converted. The complete con‐
version specification is '%%'.
Upvotes: 1