Auto Alignment in c language


Visit Our Channel for Similar tutorials

In Printf statement when we are using %2d format specifier then it indicates that 2 digit decimal values required to print, if 2 digits are not occur then go for right alignment. i.e.digits will be printed towards right side and space will be printed toward left side.

When we are using %2d format specifier then it indicates 2 digit decimal value required to print, if 2 digits are not occur then go for left alignment i.e. digit will be printed towards left side and space will be printed towards right side.

When we are using %5.3d format specifier then it indicates 5 digit decimal value withright alignment but mandatory to print 3 digits. If 3 digits arenot occur then fill with zeros.

When we are using %-5.3d fomat specifier then it indicates 5 digit decimal value with left alignment but mandatory to print 3 digits, if 3 digits are not occur, then fill will then Auto fill.

\n Theory
It is a special character which is used to print data in vertical format.

When we are using %2f formaat specifier it allows to print.

Comments