protected void TextBox3_TextChanged(object sender, EventArgs e) { int a = Convert.ToInt32(TextBox2.Text); int b = Convert.ToInt32(TextBox3.Text); TextBox4.Text = Convert.ToString(a - b / b * 100); }
The percentage increase from 30 to 40 is: (40-30)/30 * 100 = 33%
TextBox4.Text = Convert.ToString((a - b) / (b*1.0) * 100);
Convert
Parse
TryParse
ToString
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)