Output of a character constant
This output has the following format.
%wc
If w > 0 then the printing is right justify.
If w < 0 then the printing is left justify.
For eg:- let a = 'Q'
%wc
If w > 0 then the printing is right justify.
If w < 0 then the printing is left justify.
For eg:- let a = 'Q'
Statement | Output |
---|---|
printf("%4c",a); | _ _ _ Q |
printf("%8c",a); | _ _ _ _ _ _ _ Q |
printf("%5c",a); | _ _ _ _ Q |
printf("% - 7c",a); | Q _ _ _ _ _ _ |
printf("% - 4c",a); | Q_ _ _ |
printf("% 12c",a); | _ _ _ _ _ _ _ _ _ _ _ Q |
0 comments:
Post a Comment