Output of string
The format of this output is %w.ps where 'w' shows the minimum field width and 'p' shows that only the first p character will be printed.
If w > 0 then the printing is right justify.
If w < 0 then the printing is left justify.
For eg:- name = "SEETA AUR GEETA"
If w > 0 then the printing is right justify.
If w < 0 then the printing is left justify.
For eg:- name = "SEETA AUR GEETA"
Statement | Output |
---|---|
printf("%15s",name); | SEETA_AUR_GEETA |
printf("%10.6s",name); | _ _ _ _SEETA_ |
printf("%9.3s",name); | _ _ _ _ _ _SEE |
printf("% - 10.7s",name); | SEETA_A_ _ _ |
printf("% - 12.9s",name); | SEETA_AUR_ _ _ |
0 comments:
Post a Comment