A program to calculate students grades.the user
enter number of subjects and number of students then create 2D array of type Double for them.the user enter the grade of each student for each subject then
create a function which takes the 2D array of student grades and return 2D array of type String which contains the GPA of each subject for each
student
I don't know everything thats wrong here but looking over the code these are things that seemed wrong to me.
First your matrix is like a 2d array with size [studentNum][subjectNum]. Shouldnt your for loops in line 13/15 start with 0 as [0][0] would be the first element in this array. Also the last element in the array should be [studentNum-1][subjectNum-1]. So having something like i <= studentNum would make it go out of bound.
Secondly, in your main ,what is the point of grade variable.? Should it not be matrix[i][j].
Also why do you have string **GPAresult = GPA(Matrix,studentsNum,subjectsNum);
inside the 2 for loops.