Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #define CH 30
- #define P 4
- void main()
- {
- int i, j=0, arr[30][4], max = 0, avg = 0, sum = 0, h_max = 0, arr2[4], counter_failed = 0;
- for (int i = 0; i < CH; i++)
- {
- for ( j = 0; j < P; j++)
- {
- printf("Enter a grade:\n");
- scanf("%d", arr[j]);
- if (arr[i][j]>90)
- sum += arr[i][j];
- arr2[j]++;
- if (arr[i][j] <= 56)
- counter_failed++;
- }
- printf("Enter the ID of student \n");
- scanf("%d", arr[i][j]);
- avg = sum / P;
- printf("The hight average grade what big more 90 is :\n", avg);
- if (avg > max)
- max = avg;
- h_max = arr[i][j];
- }
- printf("The high average of student is :\n", h_max);
- for (i = 0; i < 4; i++)
- if ((int)arr[i] > 10)
- {
- printf("Number of student with average > 10\n", arr[i]);
- }
- printf("The student failed %d\n", counter_failed);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement