Format specifier in C :
The Format specifier is a string used in the formatted input and output functions. With the help of format specifiers the compiler understand that what is the data type of the variable while taking input through scanf() function and printing the output through printf() function. The format string always starts with a ‘%’ character.
There are many format specifiers in C. Here is the list of some commonly used format specifiers and there description :

Example:
#include<stdio.h>
int main()
{
char ch = ‘Y’;
printf(“%c\n”, ch); //printing character data
//print decimal or integer data with d and i
int x = 12, y = 10;
printf(“%d\n”, x);
printf(“%i\n”, y);
float f = 12.67;
printf(“%f\n”, f); //print float value
printf(“%e\n”, f); //print in scientific notation
int a = 39;
printf(“%x\n”, a); //print in hexadecimal format
printf(“%o\n”, a); //print in octal format
char str[] = “Welcome to Classroom!”;
printf(“%s\n”, str);
printf(“%20s\n”, str); //shift to the right 20 characters including the string
printf(“%20.5s\n”, str); //shift to the right 20 characters including the string, and print string up to 5 character
printf(“%-20.5s\n”, str); //left align and print string up to 5 character
printf(“%-20s\n”, str); //left align
return 0;
}
Y
12
10
12.670000
1.267000e+001
27
47
Welcome to Classroom!
Welcome to Classroom!
Welcome to Classroom!
Welco
Welco