title: mathematical expression entered in one text box and display its result in other text box
body: <pre><code>int a = Convert.ToInt32(Convert.ToString(Text1.Text));//here is the exception i am getting.
  int b = Convert.ToInt32(Convert.ToString(Text1.Text));
  char c = Convert.ToChar(Convert.ToString(Text1.Text));
  int result = Convert.ToInt32(Convert.ToString(Text2.Text));
  
  if (c == '+')
  {
      result = a + b;
      Text2.Text += result;
  }
  else if (c == '-')
  {
      result = a - b;
      Text2.Text += result;
  }
  else if (c == '/')
  {
      result = a / b;
      Text2.Text += result;
  }
  else if (c == '*')
  {
      result = a * b;
      Text2.Text += result;
  }
  else
      return;
  </code></pre>
  
  <p>I am getting a format exception for this code as "Input string was not in a correct format". I know this is a simple question but i didn't get answer any where.</p>
  
  <p>thank you in advance.</p>