Write a program in C.The input of this program will be a file in which each line represents one person. The person's name is first, followed by a comma. After that, separated by spaces, are an age and a single-character code (M or F) for the gender. This file contains records of people of all ages and both genders. You work for a school system that needs to produce one file containing the names of males of school age (5...18) and another for females of school age. The program must be able to read the data from the input file and select the specified items. Write data for school-age males to the file male.out and data for school-age females to female.out. Log bad data sets on the file error.log. Ignore any input data for children younger than 5 and adults older than 18.