Home Segments Index Top Previous Next

793: Mainline

The i specification is for integers. Note that xs are included in the printf statement to clarify the placement of padding characters.

Display short or integer or long:

printf ("x  
--- Result --- 
x 816 x 
x -816 x 

Display with spaces, if necessary, to fill a six-character field:

printf ("x  
--- Result --- 
x    816 x 
x   -816 x 

Display with spaces, if necessary, to fill a six-character field; if more than six characters are involved, display them all anyway:

printf ("x  
--- Result --- 
x 8160000 x 
x -8160000 x 

Display with spaces, on the right, if necessary:

printf ("x  
--- Result --- 
x 816    x 
x -816   x 

Always include sign:

printf ("x  
--- Result --- 
x   +816 x 
x   -816 x 

Always include sign and pad on the right:

printf ("x  
--- Result --- 
x +816   x 
x -816   x