I'm doing a program that needs to know the indexes of the largest values in the vector, but I'm not getting the code I tried.
#include <stdio.h>
int main(int argc, char** argv)
{
double vetor[10];
int indice[10], c = 0;
for(int i = 0; i < 10; i++)
{
scanf("%lf", &vetor[i]);
}
double maior = vetor[0];
for(int i = 0; i < 10; i++)
{
if(vetor[i] > maior)
{
maior = vetor[i];
indice[c] = i + 1;
c++;
}
}
for(int i = 0; i < c; i++)
{
printf("%d ", indice[i]);
}
return 0;
}