Question: I got this homework assignment, cant figure it out.
I need to ask the user how many town names he wants to enter. For example 5.
Then, he enters the 5 town names.
Afterwards, we need to find the average length of the names and show him the names which have less letters than the average length. Thanks for your shared time :)
My code so far:

```
static void Main(string[] args)
{

    int n;
    Console.WriteLine("How many town names would you like to enter:");
    n = int.Parse(Console.ReadLine());
    string[] TownNames = new string[n];
    Console.Clear();
    Console.WriteLine("Enter {0} town names:", n);
    for (int i = 0; i < n; i++)
    {
        Console.Write("Enter number {0}: ", i + 1);
        TownNames[i] = Convert.ToString(Console.ReadLine());
    }

    Console.ReadKey(true);
}

static void Average(double[] TownNames, int n)
{

}

```

Answer: 
You only add/multiply the last line

So is X=4\*4 = 16 for mulitply and
X=4+4 = 8 for add

the previous attempts are overwritten in the for-loop
x = i+i will get executed for each of the values and the print the last one...

so will print 8 for the add and 16 for multiplication.