Printing a space before signed values not preceded by + or - : printf sign character « printf scanf « C Tutorial






#include <stdio.h>

int main()
{ 
   printf( "% d\n% d\n", 547, -547 );

   return 0;

}
547
-547








4.3.printf sign character
4.3.1.+ Indicates that i number is printed using a sign character (+ or -).
4.3.2.' ': Indicates a space for positive values so that positive values and negative values are aligned
4.3.3.Printing a space before signed values not preceded by + or -
4.3.4.Printing numbers with and without the + flag