#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define MAX 10
void main(){
int a[MAX], AUX, i, j;
clrscr();
printf ("Llenando arreglo con 10 numeros \n");
for (i=0; i< MAX; i++) {
printf("Introdusca un numero ");
scanf("%d",&a[i]);
}
for (j=1; j <= MAX; j++){
for (i=0; i< MAX-1; i++){
if (a[i] < a[i+1]){
AUX = a[i];
a[i] = a[i+1];
a[i+1] = AUX;
}
}
}
printf ("\nArreglo ordenado\n");
for (i=0; i< MAX; i++) {
printf ("a[%d] = %d\n", i, a[i]);
}
getch();
}
Codigo Fuente txt Descargar Aqui
Borland C++ 5.1:
Turbo C 4.5:
Dev C++ 4.9.92 (Compatible con win7):
Publicar un comentario