using System;
public class Program
{
public static void Main()
int[] arr = {12, 35, 1, 10, 34, 38, 1, 50};
sortArray(arr);
}
public static void sortArray(int []arr)
int temp;
// traverse 0 to array length
for (int i = 0; i < arr.Length - 1; i++)
// traverse i+1 to array length
for (int j = i + 1; j < arr.Length; j++)
// compare array element with all next element
//Order Desc
if (arr[i] < arr[j])
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
//Order Asc
//if (arr[i] > arr[j])
//{
//temp = arr[i];
//arr[i] = arr[j];
//arr[j] = temp;
//}
// print all element of array
foreach(int value in arr)
Console.Write(value + " ");