Use System.Array.Sort() to sort an int array : Array Sort : Data Structure C# Examples


C# Examples » Data Structure » Array Sort »

 

Use System.Array.Sort() to sort an int array









    
using  System;

class  MainClass
{
        public  static  void  Main()
        {
                int[]  arr  =  {5,  1,  10,  33,  100,  4};
                Array.Sort(arr);
                foreach  (int  v  in  arr)
                      Console.WriteLine("Element:  {0}",  v);
        }
}
    
   
  
   



Output

Element: 1
Element: 4
Element: 5
Element: 10
Element: 33
Element: 100


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Array Sort