Printing with the 0( zero ) flag fills in leading zeros : printf 0s « printf scanf « C Tutorial






#include <stdio.h>

int main()
{ 
   printf( "%+09d\n", 452 );
   printf( "%09d\n", 452 );

   return 0;

}
+00000452
000000452








4.13.printf 0s
4.13.1.0 is used with whole and real numbers
4.13.2.Printing with the 0( zero ) flag fills in leading zeros