Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Sorting of Array Using Console Application in C#

Author: DevASP
Download Source Code : 443_Console_Sort_array.zip

In this simple article we will see that how we can implement Array Sorting in our console application.

Simply create a C# console application and write simple code in its main function.

 

"Olay","Sam","Smith","Alan", "John","Anny"};

                 

Console.WriteLine("Original Array: Given By User");

                 

foreach (string str in names)

      {

      Console.WriteLine(str);

      }

                 

Console.WriteLine("\n\n");

                  Console.WriteLine("Sorted Array:");

                  Array.Sort(names);

                 

foreach (string str in names)

{

      Console.WriteLine(str);

}

 

Console.WriteLine("\n\tPress Enter To Exit");

Console.ReadLine();    

Now this code takes array and Return Sorted array. So it is very useful for users.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Binary Search in Array Using Console Application in C#

Disclaimer - Privacy
© 2002-2017 DevASP.net