1
0

day_mon1.c 336 B

123456789101112131415
  1. /* day_mon1.c -- prints the days for each month */
  2. #include <stdio.h>
  3. #define MONTHS 12
  4. int main(void)
  5. {
  6. int days[MONTHS] = {31,28,31,30,31,30,31,31,30,31,30,31};
  7. int index;
  8. for (index = 0; index < MONTHS; index++)
  9. printf("Month %d has %2d days.\n", index +1,
  10. days[index]);
  11. return 0;
  12. }