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 semantic gap? Defining a useful channel includes both understanding the applications requirements and recognizing the limitations of the underlying technology. The gap

I need help in Web application that will run stand alone in IIS (MS SQL) 2 activities / Tasks Code web user management module (create user, assign license, simple authorizati

I have to develop a Google Map Fix .NET Site on Android(maybe Cross Browser issue) Project Description: A developer has implemented a characteristic which involves data from

Which command-line tool generates code and mapping for the LINQ to SQL component of .NET Framework? The SqlMetal.exe command-line tool generates code and map the LINQ to SQL co

What are the difference b/w System.String and System.StringBuilder classes? The System.StringBuilder can have mutable string where a variety of operations can be performed whil

Project Description: I am preparing a speech recognition program and need a quick code to get it done I am seeking for someone to create a Gmail API that can get subject, and co

Looking for web designer Project Description: I am seeking website designer with developing skills of Html, .Net and also supports in all browsers. Please ping your previous

Project Description: Need help to answer questions of VB.NET Skills required are .NET, Software Development, C# Programming, Visual Basic, Windows Desktop

Project Description: We require an expert developer to work on several projects for our company. You will be managed by our senior developer. Required - MUST be proficient in

What is the difference between Stored Procedure (SP) and User Defined Function (UDF)? Some of major differences between a stored procedure and user defined are as follows:-