Hello! I need to resolve the following question, but I can not.
Write an algorithm that computes the mean arithmetic of the students' 3 grades (number indeterminate number of students) of a class. O algorithm should read, in addition to the notes, the student and should be terminated when the code is equal to zero
I wrote the code below, I do not know what is wrong, because when "code = 0" it does not close. Can anyone help me?
main()
{
int codigo, n1, n2, n3, i;
float media;
while(codigo != 0){
for(i= 0; i >= 0; i++){
printf("Digite o código do aluno:\n");
scanf("%d", &codigo);
printf("Digite as 3 notas do aluno:\n");
scanf("%d %d %d", &n1, &n2, &n3);
media = ((n1+n2+n3)/3);
printf("Media = %.2f\n", media);
}
}
return 0;
}