title: How can I calculate more than 1 operation?
body: <p>I'm just starting with C# and I wish to do more than 1 calculation at a time (I'm creating a basic calculator).</p>
  
  <p>I was using this tutorial (I know it’s rather old, but it works still and my calculator actually calculates, But I don’t know how to allow it to calculate more than 1 operation, and it can only do single operations like 1 / 2 or 3 x 5 ): <a href="https://www.instructables.com/id/Creating-a-Calculator-Visual-Studio-C/" rel="nofollow noreferrer">https://www.instructables.com/id/Creating-a-Calculator-Visual-Studio-C/</a></p>
  
  <p>So I understand the basic concept, it holds your first number in a hidden variable, deletes it from the input variable, your operator ( <code>- +</code> whatever) is then put in a second hidden variable and finally your final number is added to the sequence, They are all merged in the operation and calculated, and output back to the input box in the form (I also adjusted the formula a little and a managed to get negative numbers working with it too!).</p>
  
  <p>Here’s the full source code of my project CalcForYou: <a href="https://github.com/skylerspark/project-CalcForYou" rel="nofollow noreferrer">https://github.com/skylerspark/project-CalcForYou</a></p>
  
  <p>I handle a numeric click like this:</p>
  
  <pre><code>    string input = string.Empty;
      string operand1 = string.Empty;
      string operand2 = string.Empty;
      char operation;
      double result = 0.0;
  
      private void btn1_Click(object sender, EventArgs e)
      {
          this.flatTextBox1.Text = "";
          input += "1";
          this.flatTextBox1.Text += input;
      }
  </code></pre>
  
  <p><code>+ - / *</code> click like this:</p>
  
  <pre><code>    private void btnPlus_Click(object sender, EventArgs e)
      {
          operand1 = input;
          operation = '+';
          input = string.Empty;
      }
  </code></pre>
  
  <p>and my equal button:</p>
  
  <pre><code>    private void flatButton1_Click(object sender, EventArgs e)
      {
          operand2 = input;
          double num1, num2;
          double.TryParse(operand1, out num1);
          double.TryParse(operand2, out num2);
  
          if (operation == '+')
          {
              result = num1 + num2;
              flatTextBox1.Text = "= " + result.ToString();
          }
          else if (operation == '-')
          {
              result = num1 - num2;
              flatTextBox1.Text = "= " + result.ToString();
          }
          else if (operation == '*')
          {
              result = num1 * num2;
              flatTextBox1.Text = "= " + result.ToString();
          }
          else if (operation == '/')
          {
              result = num1 / num2;
              flatTextBox1.Text = "= " + result.ToString();
          }
      }
  </code></pre>