אני מקווה שהקוד הזה יכול לעזור לך
הנה הקוד: #include <stdio.h> #include <string.h> //const SIZE 5 typedef struct { int name; int math; int history; int software; }mark; void main() { const int SIZE=5; mark Arr[SIZE]; int i,j,sum; for (i=0; i<SIZE;i++) { printf("Enter student name\n"); scanf("%d",&Arr.name); printf("Enter student remark\n"); scanf("%d%d%d",&Arr.math,&Arr.history,&Arr.software); } for (j=0;j<3;j++) //average for subject { sum=0; for(i=0;i<SIZE;i++) sum+=Arr.math++; sum=sum/5; printf("The average is:%d",sum); } /* for(i=0;i<SIZE;i++)//average for student { printf("The average of student \t%d is:",Arr.name); sum=(Arr.math +Arr.history+Arr.software )/3; printf("\t%d\n",sum); } */ }