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;
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.
thank you in advance.