0
I have an exercise that asks the teacher to type 5 notes, and display the typed notes, I wrote the code, but it’s not running the right way, someone can help?
Follows code
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "Portuguese");
int i = 0;
float nota[5];
float total = 0, media = 0;
for(i = 0; i < 5; i++)
{
printf("Digite a nota do usuário!\\n");
scanf("%f", &[i]);
}
printf("As notas digitadas foram %.2f\\n", nota[i]);
return 0;
}
scanf("%f", &[i])
What was supposed to happen on this line? Because not only is it not "running in the right way," but it is making an error during the build exactly on this line. It doesn’t even "run".– Woss
That line
scanf("%f", &[i]);
is correct?– Felipe Avelar