Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. Use the substring() function to parse the string and extract the date. The input ends with -1 on a line alone. Output each correct date as: 3-1-1990. Ex: If the input is: March 1, 1990 April 21995 7/15/20 December 13, 2003 -1 March 1, 1990 April 21995 7/15/20 December 13, 2003 ?1 then the output is: 3?1?199012?13?2003? Use the provided GetMonthAsInt() function to convert a month string to an integer. If the month string is valid, an integer in the range 1 to 12 inclusive is returned, otherwise 0 is returned. Ex: GetMonthAsInt("February") returns 2 and GetMonthAsInt("7/15/20") returns 0. 502586.3172464.q×3zqy7
main.c Load default template... \#include ?stdio.h? \#include ?string.h? int GetMonthAsInt(char *monthstring) \{ int monthint; if (strcmp(monthstring, "January") == 0 ) \{ monthInt =1; \} else if (strcmp(monthstring, "February") == 0 ) \{ monthInt =2; \} else if (strcmp(monthstring, "March") == 0) \{ monthint =3; \} else if (strcmp(monthstring, "April") == 0) \{ monthInt =4; \}) else if (strcmp(monthstring, "May") == 0 ) \{ monthInt =5; \} else if (strcmp(monthstring, "June") == 0 ) \{ monthInt =6; \} else if (strcmp(monthstring, "July") == 0 ) \{ monthInt =7; 3 else if (strcmp(monthstring, "August") ==0 ) \{ monthInt =8; \} else if (strcmp(monthstring, "September") ==0 ) \{ monthInt =9; \} else if (strcmp(monthstring, "October") == 0 ) \{ monthInt =10; \} else if (strcmp(monthstring, "November") ==0 ) \{ monthInt =11; \}) else if (strcmp(monthstring, "December") ==0 ) \{ monthInt =12; \} else \{ monthInt =8; \} return monthInt; \} int main(void) \{ // TODO: Read dates from input, parse the dates to find the ones // in the correct format, and output in m-d-yyyy format return 0; \}