When you do this:
struct aluno;
You are trying to declare a variable incorrectly. Remove this line because aluno
has already been declared before as a 5-position array with struct
type.
Look at this line:
printf("Determine a Matricula do Aluno &d: ", i+1);
Instead of &d
, you should use %d
.
These first two printf
s should be within for
, not before it.
In your second for
, you use three notes, but you have not declared all three in struct
.
I think what you wanted was this:
#define MAX 50
struct {
int ra;
char nome[MAX];
float prova[3];
} aluno[5];
int main() {
int i;
int j;
for (i = 0; i < 5; i++) {
printf("Determine o Nome do Aluno %d: ", i + 1);
fgets(aluno[i].nome, MAX, stdin);
printf("Determine a Matricula do Aluno &d: ", i + 1);
scanf("%i", &aluno[i].ra);
for (j = 0; j < 3; j++) {
printf("Determine a nota da %d Prova: ", j + 1);
scanf("%f", &aluno[i].prova[j]);
}
}
return 0;
}