answersLogoWhite

0


Best Answer

Create a data structure to store the details for each student:

typedef struct student_t {

char name[30];

unsigned age;

unsigned mark;

} student;

Establish an array to store the student data:

size_t max = 100; // replace 100 with the actual number of students

student students[max];

Use a loop to enter the data:

for (size_t i=0; i<max; ++i) {

printf ("Student name: ");

scanf ("%s", students[i].name);

printf ("Student age: ");

scanf ("%u", students[i].age);

printf ("Student mark: "); scanf ("%u", students[i].mark);

}

Calculate and display the average mark:

unsigned sum = 0;

for (size_t i=0; i<max; ++i) sum += student[i].mark;

printf ("Average mark: %d\n", sum / max_students);

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program in C that will captures details The details to be captured are student name mark and age The program should calculate and display the average marks for all the students?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which software application can best help teachers determine their students' average grades?

A grading software such as PowerSchool or Infinite Campus would be ideal for teachers to calculate students' average grades efficiently. These platforms allow teachers to input grades, track progress, and generate reports to determine the average grades of their students.


How do you calculate activa average?

how we calculate the average of activa


How do you calculate Average selling price?

how to calculate average selling price


The average age of a group of teachers and students is 20 The average age of the teachers is 35 The average age of the students is 15 What is the ratio of teachers to students?

1 : 3


How do you calculate average daily collection?

hoe do u calculate average daily collection?


The average age for teacher is 35 Students is 15 The average age of a group of students and teachers is 20 What is the ratio of teachers to students?

1:3


Calculate the average daily balance and finance charge?

Calculate the average balance and finance charge


How do you find the median if theres two in the middle?

You calculate the normal average between the two central numbers.You calculate the normal average between the two central numbers.You calculate the normal average between the two central numbers.You calculate the normal average between the two central numbers.


How do you calculate the average car weight based on engine cc?

how calculate average from engine displacement in cc


How to calculate average change IN INVENTORY?

You calculate average change in inventory by dividing the turnover by how many times it has turned over. The number you get is the average.


How do you calculate average deviation from the average value?

attiq


How do you calculate average constituency?

15475 =29% how would I calculate the average constituency for a state using the hamilton method?