**C program to sort array in descending order** is to sort or arrange the given array in descending order.

**What is sorting **

It is the technique to sort an array or arrange data in some order either in ascending order or descending order.

**Example** :-

array [] = 20, 10, 30

Sorted list in descending order is

array [] = 30, 20, 10

## Algorithm to sort array in descending order

- Declare variables. N, a[]
- Take array input from a user. a[N]
- Traverse array

For i=0 to end

If a[i] < a[i+1]

swap a[i] and a[i+1]

Else continue

If a[i]== end

stop - Print sorted array

## C program to sort array in descending order

#include<stdio.h> main() { int i,j,num,temp; printf("Enter number of elements\n"); scanf("%d",&num); int a[num]; printf("Enter numbers\n"); for(i=0;i<num;i++) { scanf("%d",&a[i]); } for(i=0;i<num;i++) { for(j=i+1;j<num;j++) { if(a[i]<a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } printf("descending oreder of given numbers is\n"); for(i=0;i<num;i++) { printf("%d\n",a[i]); } }

**Output :**