Each format specification begins with a % and ends with a character that determines the conversion, known as format control letter. In between, it may contain optional modifiers that control how much of the item's value is printed or how much of total space it gets. The following are the possible modifiers that may appear in a printf format specifier.
Format specification modifiers
Printing with fixed column width
To create a fixed-column-width report, we have to specify a number immediately after the % in the format specifier. This number shows the minimum number of characters to be printed. This is the width (minimum size) of the field. If the input in the field becomes large, it automatically grows to prevent information...