For the student array, write a program to calculate the student-wise totals and store them as a part of the structure.
Answers
Answered by
2
Explanation:
45,67,81,0}, {75,53,69,0}, { 57,36,71,0};
struct marks totals; // One more structure variable 'totals' to store totals
for (i = 0; i <= 2; i++)
{
//Computing totals for each student
student[i].total = student[i].sub1 + student[i].sub2 + student[i].sub3;
// Computing subject-wise totals and storing in 'totals'
totals.sub1 = totals.sub1 + student[i].sub1;
Similar questions