#include int main (void) { /* declarations */ int a; double x; /* executable statements */ a = 1000; x = 100.987654321; printf ("%d\n", a); printf ("%4d\n", a); printf ("%5d\n", a); printf ("%7d\n", a); printf ("\n"); printf ("%lf\n", x); printf ("%15lf\n", x); printf ("%15.4lf\n", x); printf ("%18.2lf\n", x); printf("Width 1 and 2 are too short for 100, but the number is printed with rounding\n"); printf ("%.0lf\n", x); printf ("%1.0lf\n", x); printf ("%2.0lf\n", x); printf ("%2.1lf\n", x); printf ("%2.2lf\n", x); printf ("%2.3lf\n", x); printf ("%2.4lf\n", x); printf ("%2.5lf\n", x); printf ("%2.7lf\n", x); return (0); } /* Output: 1000 1000 1000 1000 100.987654 100.987654 100.9877 100.99 Width 1 and 2 are too short for 100, but the number is printed with rounding 101 101 101 101.0 100.99 100.988 100.9877 100.98765 100.9876543 */