Read an array and perform sorting - c# program, DOT NET Programming

Read an Array and perform Sorting - C# program

Can any one assist me in performing sorting of an array.

Posted Date: 2/12/2013 1:37:21 AM | Location : United States





 

using System;

using System.Collections; // We need to implement collection class  

class ArrayList

{

  public static void Main(string []args)

 {

  ArrayList n = new ArrayList ();  

   // Read all the array items from the console

  n.Add(args[0]);

  n.Add(args[1]);

  n.Add(args[2]);

  n.Add(args[3]);

  n.Add(args[4]);  

  Console.WriteLine ("The items in the Array List before sorting are : ");  

   for (int i =0; i< n.Count; i++)

  {

   Console.Write (i + " : " +n[i]); // Print each array element

  }  

  n.Sort(); // Sort the array list

 

  Console.WriteLine ("The items in the Array List after sorting are : ");  

   for (int i =0; i< n.Count; i++)

  {

   Console.Write (i + " : " +n[i]); // Print each array element

  }

  Console.ReadLine();

 }

}

 

Posted by isbell | Posted Date: 2/12/2013 1:37:50 AM


Related Discussions:- Read an array and perform sorting - c# program, Assignment Help, Ask Question on Read an array and perform sorting - c# program, Get Answer, Expert's Help, Read an array and perform sorting - c# program Discussions

Write discussion on Read an array and perform sorting - c# program
Your posts are moderated
Related Questions
How to Enable ASP.NET polling? All our database side is configured in order to get the SQL Cache working in the ASP.NET side we require to do some configuration in the web.conf

What is a monitor object? Monitor objects are used to ensure that a block of code runs without being interrupted by code running on other threads. In other words, code in other

Locate BUG website Project Description: Can you find a bug in easports fifa 14 ultimate team web app (easports/fifa/football-club/ultimate-team) so that i will earn a lot of

What is Dynamic Language Runtime (DLR)? DLR is a runtime environment that permits you to integrate dynamic languages with the Common Language Runtime (CLR) by adding a set of s

What is the difference between "DataSet" and "DataReader"? The major differences between "DataSet" and "DataReader" are as follows:- 1)The "DataSet" is a disconnected archit

Explain Forms authentication You, as a Web application developer, are supposed to increase the Web page and authenticate the user by checking the given user ID and password aga

Question: (a) One problem encountered when designing web applications is that HTTP is a "stateless" protocol. Explain two general approaches to solve the statelessness problem

How different are interface and abstract class in .Net? Abstract classes cannot be instantiated it can have or cannot have abstract method basically called as must inherit as t

Explain ADO.NET in brief. ADO.NET is a very significant feature of .NET Framework, which is used to work with data that is stored in structured data sources, like databases and

Demonstrating use of break, continue & goto - C# Program How can i use break, continue & goto in my assignment, I am looking for a program in C#. It would be feel great if any