Thursday , July 18 2019

C #04 – Format Specifiers in C Language

Share on WhatsApp
Share via email Share


Format Specifiers

Format specifiers are the operators used in printf() function to print the data which is referred by an object or a variable. when a value is stored in a particular variable

Format specifier Characters matched Argument type
%c any single character char
%d, %i integer integer type
%u integer unsigned
%o octal integer unsigned
%x, %X hex integer unsigned
%e, %E, %f, %g, %G floating point number floating type
%p address format void *
%s any sequence of non-whitespace characters char
// file name P04.C
void main()
{
    int i=10;
    char c='A';
    float pi =3.14;

    clrscr();
    printf("%d",i);
    printf("%c",c)
    printf("%f",pi);
    getch();

}
Share on WhatsApp
Share via email Share

About Faheem

Faheem
An adaptable and responsible Software Engineer, who enjoys working with computers and the opportunity to learn new skills and work with new technologies is particularly attractive to me.

Check Also

C #08 – Loops and For Loop in C Language

  Loop in C Language A loop statement allows us to execute a statement or …

Leave a Reply

Your email address will not be published.