reads the file and function fgets() reads the file line by line. So when the program reads first line, it skips the first line of records which is
No Matrix quiz1(5%) quiz1(5%) quiz1(5%) Proj(25%) MidT(20%) Final(40%)
and is done by this code:
And you read all the marks and data in else part of the program.
while( fscanf(infile,"%d %s %d %d %d %d %d %d",&no,matrix, &quiz_1, &quiz_2, &quiz_3, &project, &midT, &final) !=EOF)
printf("%d %s %d %d %d %d %d %dn",no, matrix, quiz_1, quiz_2, quiz_3, project, midT, final);