How to find the Mode in Array C#?
<p>I want to find the Mode in an Array. I know that I have to do nested loops to check each value and see how often the element in the array appears. Then I have to count the number of times the second element appears. The code below doesn't work, can anyone help me please.</p>

<pre><code>for (int i = 0; i &lt; x.length; i ++)
{
    x[i]++;
    int high = 0;
    for (int i = 0; i &lt; x.length; i++)
    {
        if (x[i] &gt; high)
        high = x[i];
    }
}
</code></pre>
