Question: in C language 10. Write a function that processes a file containing student information. The function prototype is void file student char *infile). The function

in C language
10. Write a function that processes a file containing student information. The function prototype is void file student char *infile). The function takes the input file name as parameter. The input file has the following format. The first line contains the number of students in the file. Each subsequent line contains information about one student. Each line contains three fields namely name, age, and gpa in that order separated by blanks. The name is a single word. The age is an integer. The gpa is a double type value. A structure type representing a student is defined. An array of student structures is dynamically allocated. The length of the array is the same as the number of students in the file. The student information is stored into the array of structures. Then the following tasks are performed. Print the average gpa of all students. Print the names of those students whose gpa is at least 2. Print all the student information in the ascending order of names. The dynamic array is freed when the function completes its work. No other array can be used
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
