According to K&R C section 1.6, a char is a type of integer. So why do we need %c. And why can\'t we use %d for everything?
char
%c
%d
%d is used to print decimal(integer) number ,while %c is used to print character.If you try to print a character with %d format the computer will print the ASCII code of the character.
decimal(integer)
character
ASCII