Refer this code
HTML
<div>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
Quantity
</td>
<td>
<asp:TextBox ID="txtQuantity" Text="10" runat="server" />
</td>
<td>
Actual Price
</td>
<td>
<asp:TextBox ID="txtActualPrice" Text="130" runat="server" />
</td>
</tr>
<tr>
<td>
Sale Price
</td>
<td>
<asp:TextBox ID="txtSalePrice" Text="185" runat="server" />
</td>
<td>
Profit
</td>
<td>
<asp:Label ID="lblProfit" runat="server" />
</td>
</tr>
</table>
<br />
<asp:Button Text="" OnClick="GetProfit" runat="server" />
</div>
C#
protected void GetProfit(object sender, EventArgs e)
{
double quantity, actualPrice, salePrice, sale = 0;
double.TryParse(this.txtActualPrice.Text.Trim(), out actualPrice);
double.TryParse(this.txtQuantity.Text.Trim(), out quantity);
double.TryParse(this.txtSalePrice.Text.Trim(), out salePrice);
double investment = quantity * actualPrice;
sale = quantity * salePrice;
double percentage = 0;
percentage = investment / sale;
percentage = percentage * 100;
this.lblProfit.Text =Math.Round(percentage).ToString();
}