title: How to calculate the average value in 2 textboxes in C#?
body: <p>I need to make a program that calculates 2 numbers that are put in through 2 text boxes (each text box has a number). the program must also calculate the average value, max average value and min average value and then shows it all on each label. The program uses 4 labels (every label shows something different, the first one shows the result, the second one shows the average value,...), 2 textboxes, a button and 2 radio buttons (they can be checked if you need to cumulate or substract the numbers). The program is being made in Windows form application. I dont know how to write the code for the average values. Can anybody help me and write the code?</p>
  
  <pre><code>public Form1()
      {
          InitializeComponent();
      }
  
      private void btnIzracunaj_Click(object sender, EventArgs e)
      {
          if (rndPlus.Checked)
          {
  
              lblRezultat.Text = (txtSt1.Text + txtSt2.Text).ToString();
  
  
          }
          else if (rndMinus.Checked)
          {
  
              lblRezultat.Text = (Convert.ToDecimal(txtSt1.Text) - Convert.ToDecimal(txtSt2.Text)).ToString();
  
          }
  
  
  
      }
  }
  </code></pre>
  
  <p>}   </p>