/* * formatint1.c - format field width */ #include int main(void) { // Printing integers right justified with a field width of 10 chars spaces printf("Right Justified 10 chars field\n"); printf("12345678901234567890<--- column or character numbers.\n"); printf("%10d%10d\n", 1,7); printf("%10d%10d\n", 12,78); printf("%10d%10d\n", 123,789); printf("%10d%10d\n", 1234,7890); // printing integers left justified with a field width of 10 characters printf("Left Justified 10 chars field\n"); printf("12345678901234567890<--- column or character numbers.\n"); printf("%-10d%-10d\n", 1,7); printf("%-10d%-10d\n", 12,78); printf("%-10d%-10d\n", 123,789); printf("%-10d%-10d\n", 1234,7890); return 0; }