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

el while no esta de mas ?? asi igual funciona,..


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;
    
max = vector[0];


            for (
i=0; i<10; i++)
            {
                if (
vector[i] >max)
                {
                    
max = vector[i];
                }

            }

//  se cumple el for


    
printf("%i", max);

    
getch();
} 

Última edición por vani18; 10/01/2013 a las 23:16