सबसे पहले, Unsorted Array Set करें।
int[] list = {98, 23, 97, 36, 77};Sort() Method का उपयोग करके Array Sort करें।
Array.Sort(list);
Array को Ascending Order में Sort करने के लिए निम्न Code Run कर सकते हैं।
Example
using System; namespace Demo { public class MyApplication { public static void Main(string[] args) { int[] list = {98, 23, 97, 36, 77}; Console.WriteLine("Original Unsorted List"); foreach (int i in list) { Console.Write(i + " "); } Array.Sort(list); Console.WriteLine("\nSorted List"); for(int i=0; iOutput
Original Unsorted List 98 23 97 36 77 Sorted List 23 36 77 97 98