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
What is the difference between Authentication and authorization? This is  a tricky question. These two concepts seem altogether same  but there is big  difference. The Authenti

Audio Expert in C# Required - Generate Audio Engine, Exciting Project! Project Description: We need an EXPERT CODER to help us create an 'audio engine' in C#. We need to b

What is CMMI? This is a collection of instructions an organization can follow with the purpose to gain the better control over its software development process. According to

What is DISCO? DISCO is a method developed by Microsoft to publish and discover Web services. It discovers URLs of all XML Web services located on a Web server and develops a

Project Description: I want a new payment gateway of my own. Anyone who has previous experience in preparing a new payment gateway. I mean new payment gateway not any integratio

Help with making a wrapper in c# for ffmpeg to extract audio from video

Custom authentication: If we don't need ASP.NET to perform any authentication, we can set the authentication mode to none. The reason behind this decision could be: We don't


Can you give a practical implementation of FAÇADE patterns? The Façade pattern sits on the top of lot of the subsystems & makes access easy to interfaces of these subsystems. T

What are benefits and limitations of using Cookies? The benefits of using cookies for state management are as follows:- 1)    There is no server resources required as they a