There are 10 people in a class (the specific number is entered by the keyboard) to take the final exam, and there are 3 exams. Define the structure type to describe student information. Each student information includes: student ID, name, grades of multiple courses, total grades and average grades. Using the array of structures as the function parameters, program the student achievement management system as follows.
(1) Enter each student's student ID, name, and test scores for each subject.
(2) Calculate the total score and average score of each course.
(3) Calculate the total score and average score of each student.
(4) Output each student's student ID, name, test scores of each subject, and the total and average scores of each course.solution for this c program
Answers
Answered by
0
Answer:#include <stdio.h>
struct student {
char name[50];
int roll;
float marks;
} s;
int main() {
printf("Enter information:\n");
printf("Enter name: ");
fgets(s.name, sizeof(s.name), stdin);
printf("Enter roll number: ");
scanf("%d", &s.roll);
printf("Enter marks: ");
scanf("%f", &s.marks);
printf("Displaying Information:\n");
printf("Name: ");
printf("%s", s.name);
printf("Roll number: %d\n", s.roll);
printf("Marks: %.1f\n", s.marks);
return 0;
}
Explanation:
Similar questions
Computer Science,
5 months ago
Biology,
5 months ago
Computer Science,
5 months ago
Math,
11 months ago
Math,
11 months ago
Science,
1 year ago
Math,
1 year ago