# C Program To Arrange Numbers In Descending Order

C Program To Arrange Numbers In Descending Order. If you are looking for sort the array in descending order program in C, here in this tutorial we will help you to learn how to write a c program to C program to arrange the given numbers in descending order.

## C Program To Arrange Numbers In Descending Order

Learn how to write a c Program to arrange array elements in descending order. Writing descending order program in C can be done using various techniques but here in this program, we show how to write a c program to arrange numbers in descending order in a proper way. Happy coding.

### C Program to Arrange Numbers in Descending Order Source Code

Just copy paste the below source code to arrange numbers in descending order in C compiler to test, how the source code works. Happy Learning.

```/* C program to arrange numbers in descending order DescOrder.C */

#include <stdio.h>

void main ()
{
//variable declaration
int number;
int i, j, a, n;

//asking user to enter size of array
printf("Enter the value of N\n");

//asking user to enter array elements
printf("Enter the numbers \n");
for (i = 0; i < n; ++i)

/* Logic for sorting and checking */

for (i = 0; i < n; ++i)
{
for (j = i + 1; j < n; ++j)
{
if (number[i] < number[j])
{
a = number[i];
number[i] = number[j];
number[j] = a;
}
}
}

printf("The numbers arranged in descending order are given below\n");
for (i = 0; i < n; ++i)
{
printf("%d\n", number[i]); //printing numbers in descending order
}
}```

### C Program to Arrange Numbers in Descending Order Output

Enter the value of N

3

Enter the numbers

5

23

16

The numbers arranged in descending order are given below

23

16

5