how to take average of two text box values C# -
I used this code, but it seems that it does not work.
Private zero txtBfrLeft1_Leave (Object Sender, EventArgs E) {If (txtBfrRight1.Text! = "" || txtBfrLeft1.Text! = "") {Int befrAvg1 = (convert. (TxtBfrRight1. Text) + Convert. Repeat (txtBfrLeft1.Text)) / 2; TxtBfrAvg1.Text = BIFVG 1.ToString (); }}
Try it out:
double bef 1 = (new [] {double. Purse (txtBfrRight1.Text), double. Purse (txtBfrLeft1.Text)}). Average ();
Or if you want the result as an integer then it:
int befrAvg1 = (int) ((new [] {double. Parse (TxtBfrRight1.Text), Double Percy (txtBfrLeft1.Text)}). Average ());
Comments
Post a Comment