6 indicates that the output column is 6 characters wide. If the actual output is less than 6 characters, the rest positions are filled with spaces. If the actual output exceeds 6 characters, the output is based on the actual width. The minus sign in front indicates that the space is filled on the right (if there is no minus sign, the space is filled on the left), that is:
printf("%-6d ", 123);
The output result is (the decimal point represents a space):
123 ...
printf("%6d ", 123);
The output result is (the decimal point represents a space):
... 123