Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/01/2013, 14:38
vani18
 
Fecha de Ingreso: junio-2010
Mensajes: 752
Antigüedad: 16 años, 4 meses
Puntos: 5
ordenar numeros maximo

hola que error, hay aca, por que me toma como mayor al 7...

Código PHP:
#include <stdio.h>
#include <conio.h>
main()
{
    
int vector[10]={3, 7, 14, 2, 9, 1, 0, 4, 6, 1}, i=10, j=1, max=0, min=0, aux[10];
    
max = vector[0];
    while(
j < 10)
    {
        for (
i=0; i<10; i++)
        {
            if (
vector[i] > vector[i+1])
            {
                
max = vector[i+1];
            }
            
aux[j] = max;
            
j++;
        }
    }
    
printf("%i", aux[j]);
    
getch();
}