Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2008 | Question 78
  • Last Updated : 13 Jun, 2018
GeeksforGeeks - Summer Carnival Banner

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


Answer: (C)

Explanation: To left justify, use a negative number in the field width:

printf("NYU has %-10d students", numStudents);

// Output:
// NYU has 35123 students

So, option (C) is correct.

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :