I have to make a program that will read 4 notes from each of the 6 students in a class and store them in an array NOTES [6] [5]. For each student, one should calculate the arithmetic mean of the 4 notes and store this average in the last column of the matrix (index column 4). The program should also print the average of each student and, finally, the arithmetic average of the class.
I made a code and was executed, at the time of getting STUDENT 6 NOTE 2, instead of being typed STUDENT 6, it types a totally random number, and ends the program, and depending on the code of the different errors! / p>
What error am I making?
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main() {
setlocale(LC_ALL, "Portuguese");
float nota[6][5], media;
int i, j;
media = 0;
for(i=1; i<=6; i++) {
for(j=1; j<=5; j++) {
printf("\nAluno %d Nota %d \n", i, j);
scanf("%f", ¬a[i][j]);
}
}
for(i=1;i<=6;i++)
{
for(j=1;j<= 5;j++) {
printf("%f", nota[i][j]);
}
printf("\n");
}
for(i=0; i<=6; i++) {
for(j=0; j<5; j++) {
nota[i][5] = nota[i][5] + nota[i][j];
}
}
for(i=0; i<=6; i++) {
nota[i][5] = nota[i][5]/4;
media = nota[i][5] + media;
}
media = media/6;
for(i=0; i<=6; i++) {
printf("\nA média do aluno %d = %.2f", i, nota[i][5]);
}
printf("\nA média dos alunos: %.2f", media);
return 0;
}