c# forms problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

c# forms problem

I am making a math problem solver and one of the things it needs to solve is a Biquadratic equation, but it gives me an error (Method name expected) this is the code, could someone assist me on how to fix it? (MessageBox.Show("x1 = {0} , x2 = {1}", Math.Sqrt(D)(-c / b), -Math.Sqrt(-c / b)); <-- error comes on this line at math.sqrt) private void button2_Click(object sender, EventArgs e) { if (a == 0 && b == 0 && c == 0) { MessageBox.Show("Every x is solution"); } else { MessageBox.Show("No solution"); } if ((-c / b < 0)) { MessageBox.Show("No real solution"); } else { MessageBox.Show("x1 = {0} , x2 = {1}", Math.Sqrt(D)(-c / b), -Math.Sqrt(-c / b)); } }

1st Nov 2022, 9:33 AM
Emperall
Emperall - avatar
1 Answer
+ 3
* operator missing.. else { MessageBox.Show("x1 = {0} , x2 = {1}", Math.Sqrt(D) * (-c / b), -Math.Sqrt(-c / b)); }
1st Nov 2022, 10:03 AM
Jayakrishna 🇮🇳