I need to use a loop in the there, which will check the dates are in range from 1-31, months are from 1-12, and year from 1900-2012, otherwise it will ask again. Tried a while loop but gets very complicated and then the function does not work anymore. Can someone help please?Code:void getDate(Car_t fleet[], int z, char dateType) /*Function that gets the date from the user*/ { int day, month, year; /*put a loop here to error check*/ if(dateType = 'm') printf("Please enter manufacture date in dd/mm/yyyy format> "); else if (dateType = 'p') printf("Please enter purchase date in dd/mm/yyyy format> "); else printf("Error, unknown date format\n"); scanf("%d/%d/%d", &day, &month, &year); /*end loop here*/