C # Finding the root of a quadratic equation
Using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. threading. tasks; using System. windows. forms; namespace evaluate the root {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private double [] Root2 (double a, double B, double c) {double [] Roots = new double [2]; double Delt = B * B-4 * a * c; if (Delt> = 0) {Roots [0] = (-B + Math. sqrt (Delt)/2 * a; Roots [1] = (-B-Math. sqrt (Delt)/2 * a; return room ts;} else {room = null; return room ts;} private void button2_Click (object sender, EventArgs e) {Application. exit ();} private void button#click (object sender, EventArgs e) {if (Root2 (double. parse (textBox1.Text), double. parse (textBox2.Text), double. parse (textBo X3.Text) = null) {MessageBox. Show ("no real root! "," Error message ", MessageBoxButtons. OK, MessageBoxIcon. warning); return;} textBox4.Text = Root2 (double. parse (textBox1.Text), double. parse (textBox2.Text), double. parse (textBox3.Text) [0]. toString (); textBox5.Text = Root2 (double. parse (textBox1.Text), double. parse (textBox2.Text), double. parse (textBox3.Text) [1]. toString ();}}}