define an array of 12 structures of type DayMon. Name the array maps[] and initialize the array with the names of the 12 months in a year and the number of days in each month.

Respuesta :

Answer:

#include<stdio.h>

int main(){

 

   int i,n;

   char* maps[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};

   for(i=0;i<12;i++){

       printf("%s\n", maps[i]);

   }

   printf("\n");

 

   int days[] = {31,28,31,30,31,30,31,31,30,31,30,31};

   for(i=0;i<12;i++){

       printf("%s %d\n", maps[i], days[i]);

   }

   printf("\n");

 

   return 0;

}

Explanation:

The C source code above declares two arrays, the maps array which is initialized with the months of the year and the days array which is initialized with the number of days of each month in the maps array. Both arrays are printed out side by side like a table of months and the days in each month.