निम्न Integer Array है:
int[] arr = { 99, 43, 86 };Sort करने के लिए, Sort() Method का उपयोग करें।
Array.Sort(arr);
निम्न Complete Code दर्शाता है कि C# में Sort() Method का उपयोग करके Array को कैसे Sort करें।
Example
using System; class Demo { static void Main() { int[] arr = { 99, 43, 86 }; // Sort Array.Sort(arr); Console.WriteLine("Sorted List"); foreach (int res in arr) { Console.Write("\n" + res); } Console.WriteLine(); } }Output
Sorted List 43 86 99