How do I not display those gigantic numbers referring to the empty positions of my vector?
My code:
int main(int argc, char** argv) {
double notas[10];
double soma = 0, media = 0;
int i, P[10];
int j = 0, count = 0;
for(i=0;i<10;i++){
printf("Digite %d: ", i);
scanf("%lf", ¬as[i]);
}
for(i=0;i<10;i++){
if(notas[i] > 5){
soma = soma + notas[i];
count++;
}
}
media = soma/ count;
for(i=0;i<10;i++){
if(notas[i]>= media){
P[j] = i;
j++;
}
}
printf("%.2lf\n", media);
for(i=0;i<10;i++){
printf("%d ", P[i]);
}
return (EXIT_SUCCESS);
}
Output:
Curiosity: What are the names of these big numbers that appear?