title: How can I get the mode (Statistic) in Visual Studio?
body: <p>Basically, in a textbox (txtEl) I'm writing the length of the vector, then add it random numbers (from 1 to 500), showing all of them in a listbox. But I don't know how to get the mode from all those numbers.</p>
  
  <pre><code>        Random Aleatorio = new Random();
          int x = Convert.ToInt16(txtEl.Text);
  
          int[] elementos = new int [x];
  
          int moda = 0;
  
          for (int i = 0; i &lt; elementos.Length; i++)
          {
              elementos[i] = Aleatorio.Next(1, 500);
              listEl.Items.Add(elementos[i].ToString());
  
  
  
          }
  </code></pre>