Sort Array in Descending Order in C


Write a C program to sort a list of given 5 numbers in descending order. [June 2014, Set-4]

#include <stdio.h>

int main()
{
    int Arr[5] = {10,8,15,3,7};
    int i, j, temp;
	
    for (i = 0; i < 4; i++)
    {
        for (j = 0; j < (4 - i); j++)
        {
            if (Arr[j] < Arr[j + 1])
            {
                temp = Arr[j];
                Arr[j] = Arr[j + 1];
                Arr[j + 1] = temp;
            }
        }
    }
	
    for (i = 0; i < 5; i++)
    {
        printf("%d ", Arr[i]);
    }

    return 0;
}