0
I’m new to C programming. My problem is that I’m not able to add float numbers with an i counter, which would be integer, which is the best solution?
#include <stdio.h>
#include<stdlib.h>
int main()
{
float nota[4];
int i;
for(i=0; i<4; i++){
printf("Digite a nota posição %d", i);
scanf("%f", nota[i]);
}
for(i = 0; i < 4; i++){
printf("A nota posição %d é = %.2f\n",i, nota[i]);
}
return 0;
}
Why you want to put float inside a counter?
– Gabriel Oliveira
What does "I’m not getting it"? Doesn’t the program compile? Doesn’t it work? Shows different values than expected?
– epx