is there a command for sorting an array in c# code example
Example: sorting array in c#
int[] arr = { 3, 6, 4, 1 };
// arr will be { 1, 3, 4, 6 }
Array.Sort(arr);
// arr will be { 6, 4, 3, 1 }
Array.Sort(arr);
Array.Reverse(arr);
int[] arr = { 3, 6, 4, 1 };
// arr will be { 1, 3, 4, 6 }
Array.Sort(arr);
// arr will be { 6, 4, 3, 1 }
Array.Sort(arr);
Array.Reverse(arr);