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?

  1. A.

    the values are displayed right justified

  2. B.

    the values are displayed centered

  3. C.

    the values are displayed left justified

  4. 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.

Explore the full course: Isro