Hello!
My program objective is to sort a string.Code:main() { char nome[] = "iiooeeuuaa"; int i; for(i = 0; nome[i] != '\0'; i++) { int j; for(j = 0; j < nome[i] != '\0'; j++) { if(nome[i] < nome[j]){ char aux = nome[i]; nome[i] = nome[j]; nome[j] = aux; } } } int j; for(j = 0; nome[j] != '\0'; j++){ printf("%c", nome[j]); } printf("\n"); }
the output must be: aeiou
but this is what happens: aaeeiioouu
thanks