The question was,

In Bouboun University's information systems 3 arrays are used to store student details,

1. Stud_Names (array of strings) holds the name of 100 Students

2. Stud_Map (array of strings) hold the ids of the 100 students (whose details are stored in Stud_Name)

3. Stud_Marks_Mod1 (array of floats) holds the grades of grades of each of the 100 students in Module1

4. Stud_Marks_Mod2 (array of floats) holds the grades of grades of each of the 100 students in Module2

5. Stud_Marks_Mod3 (array of floats) holds the grades of grades of each of the 100 students in Module3

Write a program in C which computes the average marks for each student and displays the highest average.

Problem: When I enter details for the first student it is correct but when I enter the second student details I cannot enter the name. It skip it and student ID come in its place. Any advice on how to correct the codes?

My program:

#include

#include

int main()

{

char Stud_Names[100];

char name;

char Stud_ID[100];

float Stud_Marks_Mod1[100];

float Stud_Marks_Mod2[100];

float Stud_Marks_Mod3[100];

const int MAXLENGTH = 100;

int b=1,i,sum=0;

float avg,avg1;

int max=0;

for(i=0;imax)

{

printf("Highest average mark is %.2f ", avg1);

}

return 0;

}

More Nitish Mohiputlall's questions See All
Similar questions and discussions