I'm trying to make this problem, but the result always goes awry.
"Make a program that creates a 10-position vector filled by the user. Scan the vector and whenever the value of the i-position of the vector is less than the value of the i + 1 position you must change them. "
#include <stdio.h>
int main()
{
int i,vet[10],aux;
aux = 0;
for(i=0;i<10;i++)
{
printf("Digite um valor:\n");
scanf("%d",&vet[i]);
}
for(i=0;i<9;i++)
{
if(vet[i]<vet[i+1])
{
aux = vet[i];
vet[i] = vet[i+1];
vet[i+1] = aux;
}
}
printf("\n");
for(i=0;i<10;i++)
{
printf("%d\n",vet[i]);
}
return 0;
}