In C, what is the effect of a negative number in a field width specifier?
2008
In C, what is the effect of a negative number in a field width specifier?
- A.
the values are displayed right justified
- B.
the values are displayed centered
- C.
the values are displayed left justified
- D.
the values are displayed as negative numbers
Attempted by 1780 students.
Show answer & explanation
Correct answer: C
In C, a negative number in the field width specifier indicates left justification. This causes padding to be added on the right side of the output, rather than the default left-side padding.