Done
This commit is contained in:
8
Q2.c
8
Q2.c
@@ -54,9 +54,13 @@ int main() {
|
||||
printf("Average Grade: %0.02f\n", student_average_grade(arr[0]));
|
||||
printf("Average Grade: %0.02f\n", student_average_grade(arr[1]));
|
||||
printf("Average Grade: %0.02f\n", student_average_grade(arr[2]));
|
||||
printf("Average Grade: %0.02f", all_student_averages(arr, 3));
|
||||
printf("Average Grade: %0.02f\n", all_student_averages(arr, sizeof(arr) / sizeof(arr[0])));
|
||||
|
||||
//("Student with highest grades: ")
|
||||
// It is impossible to print the name of the student with the highest total marks,
|
||||
// Because it is a union, and if the student has marks, they cannot have the name member also populated
|
||||
// Therefore, this will print nonsense for the name of the student with highest grades
|
||||
Student highest = highest_grade(arr, sizeof(arr) / sizeof(arr[0]));
|
||||
printf("Student with highest grades: %s", highest.name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user