Format Specifier in C by R4R Team

Format specifier are used in C language for print the different data type value.
Each data type have seperate Format specifier in C language.

Example-

int : %d
float : %f
char : %c
string : %s
address : %u
etc.


program-

#include< stdio.h>
int main()
{
int a=1;
float b=3.2;
char c='a';
printf("%d\n",a);
printf("%f\n",b);
printf("%c",c);
}


output-

1
3.200000
a

-In this program, we define 3 variable of interger, float and char data type,
-then then in printf(), we use %d,%f,%c for ine,float and char respectively.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!