Sunday 25 August 2013

best sorting program in C#


Que- Write an array in C Sharp of length 3, and sort it???

Ans:- using System;
using System.Collections.Generic;
using System.Text;

namespace codeforevenorodd
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] number=new int[]{3,6,1,30,2};
            Array.Sort(number);
           foreach(int i in number)
           {
               Console.WriteLine(i);
           }
           Console.ReadLine();
        }
      
        }
    }
 

No comments:

Post a Comment