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.
I think what you mean is that you want to reverse an array. So if you have this array:

```
int[] a = new int[] { 0, 1, 2, 3 };

```

You want to reverse the elements so that they're `{ 3, 2, 1, 0 }`.

The key is that you want to swap elements. For example, if you were to write:

```
// swap first and last elements
int temp = a[0];
a[0] = a[a.Length - 1];
a[a.Length - 1] = temp;

```

Then your array would be `{ 3, 1, 2, 0 }`.

The idea, then, is to swap `a[0]` and `a[length-1]`. Then swap `a[1]` and `a[length-2]`, etc. until you've swapped each item with its counterpart.

You can do this with a single loop.

By the way, the `Reverse` method only works on the `List` type. For arrays, the `Reverse` method is actually a LINQ extension method, and you need to create a new array. For example:

```
int[] b = a.Reverse.ToArray();

```