title: C# at first button click my program doesn't fill all array elements, why?
body: <p>I've created a "random password generator" app (I'm a beginner, just for practicing) and somehow at first button click it only fills 5-6-7 elements of my array. </p>
  
  <p>This code might be strange (for generating random characters), I just looked ASCII table and searched for numbers, letters and I've put them into random min and max number. </p>
  
  <pre><code> string[] ch = new string [11];
   Random r = new Random();
  
   private void button1_Click(object sender, EventArgs e)
   {
      for (int i = 0; i &lt;= 9; i++)
      {
          if (Convert.ToInt64(r.Next()) % 3 == 0)
              ch[i] = Convert.ToString(Convert.ToChar(r.Next(49, 57)));
           else if (Convert.ToInt64(r.Next()) % 3 == 1)
               ch[i] = Convert.ToString(Convert.ToChar(r.Next(65, 89)));
           else if (Convert.ToInt64(r.Next()) % 3 == 2)
               ch[i] = Convert.ToString(Convert.ToChar(r.Next(97, 122)));
       }
       pass.Text = (Convert.ToString(ch[0] + "" + ch[1] + "" + ch[2] + "" + ch[3] + "" + ch[4] + "" + ch[5] + "" + ch[6] + "" + ch[7] + "" + ch[8] + "" + ch[9]));   
  </code></pre>
  
  <p>To decide to use number (ascii 49-57) small letters (65-89) or bigs (97-122) I just made a random number then (truncating divided?) divided by 3 and result is then 0,1 or 2 then made ifs for them. </p>
  
  <p>Might be stupid but its my own idea. So when I click on the button, at first time it shows only about 5,6,7 elements of arrays. Anybody knows why?</p>