Format Specifier in C

#include<stdio.h>
void main ()
{
    char str[] = "shirleyanengineer";

    printf("%20s \n%-35s\n"
           "%-35.6s \n %35.7s \n",
           str, str, str, str);

    return;
}


   shirleyanengineer
shirleyanengineer                  
shirle                               
                             shirley


Usage : These format specifier are used in writing into a file for user readability. 

Comments