title: Simple Windows Application program in C# confusion
body: <p>My program is messed up bad, and I need help!
  I already tried c++, and c# is new for me. Experts here at the university said that c# is like c++, and so I tried to widen my perspective on other programming languages other that c++. I tried to make a program that computes the sum of the lowest 3 numbers in 5 inputted numbers on windows application.</p>
  
  <p>to view the design of the windows application is here:
  <a href="http://i.stack.imgur.com/zjwgX.png" rel="nofollow">Design View</a></p>
  
  <p>and my messed up code:</p>
  
  <pre><code>namespace Array_excercise
  {
     public partial class Form1 : Form
     {
      public Form1()
      {
          InitializeComponent();
      }
      int[] nums = { 0, 0, 0, 0, 0 };
      int[] lownum = { 0, 0, 0,0,0 };
      int[] highnum = { 0, 0, 0, 0, 0 };
      private void computbtn_Click(object sender, EventArgs e)
      {
          nums[0] = Int32.Parse(textBox1.Text);
          nums[1] = Int32.Parse(textBox2.Text);
          nums[2] = Int32.Parse(textBox3.Text);
          nums[3] = Int32.Parse(textBox4.Text);
          nums[4] = Int32.Parse(textBox5.Text);
          int result;
          for (int a = 0; a &lt;= 4; a++)
          {
              if (nums[a] &lt; nums[0])
                  lownum[a] = nums[a];
              else if (nums[a] &lt; nums[1])
                  lownum[a] = nums[a];
              else if (nums[a] &lt; nums[2])
                  lownum[a] = nums[a];
              else if (nums[a] &lt; nums[3])
                  lownum[a] = nums[a];
              else if (nums[a] &lt; nums[4])
                  lownum[a] = nums[a];
              else
                  highnum[a] = nums[a];
          }
      }
  }
  </code></pre>
  
  <p>After that, I don't know how to compute the sum.
  for now, I'm particularly learning how to use arrays with if and for loop functions.
  I'll be very grateful if those functions are used in this program.</p>
  
  <p>I thank you in advance!</p>