Question: I am new at learning how to make 10 or 20 or 25 number table. I am doing 10 number table. For example I have 4 number table 1,2,3,4 and want at the end to write it like 4,3,2,1 - can someone tell me how to do that? 

My program 

```
    static void Main(string[] args)
    {
        int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30, 0, 1, 4 };
        int vsota = 0;
        float povprecje = 0;

        for (int i = 0; i < p.Length; i++)
        {
            Console.WriteLine("p [{0}] = {1,3}", i, p[i]);
            vsota += p[i];
        }
        povprecje = (float)vsota/p.Length;
        Console.WriteLine();
        Console.WriteLine("Vsota = {0}!", vsota);
        Console.WriteLine("Povprecje = {0}!", povprecje);
        Console.ReadKey(true);
    }

```

Answer: 
You can use [Linq's](http://msdn.microsoft.com/en-us/library/gg145016.aspx) [OrderBy](http://msdn.microsoft.com/en-us/library/bb343617.aspx) and [OrderByDescending](http://msdn.microsoft.com/en-us/library/bb292260.aspx) methods to sort a collection. In your example:

```
int[] p = new int[10] { 2, 9, 13, 3, 50, -8, -30, 0, 1, 4 };
p = p.OrderByDescending( x => x ).ToArray();

```

**Edit**: added the expression to the OrderByDescending method. Also, Linq is for the 3.5 and above framework and requires reference to the System.Linq namespace.
To reverse the array:

```
p = p.Reverse().ToArray();

```