/* CH9B.C */ /* Calculates average exam mark for each student and overall average */ #include main () { /* Description ...... Prepare the files for processing Write headings Initialise grand total FOR each student Initialise student total FOR each paper Read mark Accumulate student total and grand total Calculate and write student average Calculate and write overall average Close files */ /* const and variable declarations */ const int num_of_students = 6, num_of_papers = 4 ; int student_num, paper_num ; float mark, student_total, student_average, grand_total, overall_average ; FILE *inpfile = fopen ("ch9b.dat", "r") ; FILE *outfile = fopen ("results.dat", "w") ; }