I'm trying to make a code to show 3 random numbers in ascending order typed by the user however I do not understand why my code is not working
#include <stdio.h>
main(){
int numeros[3],a,b,c,maior=0,menor=0,medio=0;
printf("Digite 3 numeros:\n");
scanf("%d %d %d",&numeros[0],&numeros[1],&numeros[2]);
for(a=0;a<3;a++){
if(numeros[a]>numeros[a+1]){
numeros[a]=maior;
}
}
for(b=0;b<3;b++){
if(numeros[b]<numeros[b+1]){
numeros[b]=menor;
}
}
for(c=0;c<3;c++){
if(numeros[c]<maior && numeros[c]>menor){
numeros[c]=medio;
}
}
printf("%d %d %d",menor,medio,maior);
output appears only 0 in all 3 positions.