What does the format %10.2 mean when included in a printf statement?

4 years ago
C Programming

This format is used for two things: to set the number of spaces allotted for the output number and to set the number of decimal places. The number before the decimal point is for the allotted space, in this case it would allot 10 spaces for the output number. If the number of space occupied by the output number is less than 10, addition space characters will be inserted before the actual output number. The number after the decimal point sets the number of decimal places, in this case, it's 2 decimal spaces.

0
Sanisha Maharjan
Jan 20, 2022
More related questions

Questions Bank

View all Questions