Since you apparently have not been introduced to an array, let's just work thru this, without it.
Code:
int r, c, hiRow, average, total, rows, cols, exclude, score, hiscore;
FILE *ifp;
ifp = fopen("filename.txt", "r");
if(ifp==NULL) {
printf("\nError opening filename.txt file");
return 1;
}
fscanf (ifp, "%d%d%d", &rows, &cols, &exclude);
printf("Rows: %d Columns: %d Exclude" %d\n", rows, cols, exclude);
for(r=0;r<rows;r++) {
for(c=0;c<cols;c++) {
fscanf(... , "%d", &score);
//add your exclude logic code, in here
if(score is to be included) then {
total += score;
if(r==0 && c==0) {
hiscore = score;
hirow = 0;
}
else {
if(score > hiscore) {
hiscore = score;
hirow = r;
}
}
average = total /(row * col);
}
You have to be careful to do everything you need, before you loop back around for another input from the file. There's no "going back to the scores", in this kind of logic.
The above is not runnable code, as is. It's meant to give you good idea's, if you want to use this kind of logic, but it is not meant to be a runnable program, as is.
If you have trouble understanding the logic, try doing this exercise SLOWLY, by hand on paper, and see if it makes more sense, as you become more familiar with the problem.