I am with pending exercise to find the largest element in a fixed vector of 10 elements. But when I declare the integer of the vector works, but when I ask the user to enter the values it does not work.
int i, v[10];
int maior = v[0];
for(i = 1; i < 10; i++){
scanf("%d", &v[i]);
if(maior < v[i])
maior = v[i];
}
printf("Maior = %d\n", maior);