I would suggest doing a descending sort array and then calling the function with some pointer arithmetic. Example,


printf("%d", *iptr);
iptr++;
printf("%d", *iptr);