3
When I compile this code, it appears: a1 vale NaN(Não é um número) and then: a2 vale NaN(Não é um número), follows the code:
private void button1_Click(object sender, EventArgs e)
{
    int a = 2;
    int b = 3;
    int c = 5;
    double delta;
    double a1;
    double a2;
    delta = (b * b) - 4 * a * c;
    a1 = (-b + Math.Sqrt(delta)) / (2 * a);
    a2 = (-b - Math.Sqrt(delta)) / (2 * a);
    MessageBox.Show("a1 vale " + a1);
    MessageBox.Show("a2 vale " + a2);
}
Root of a negative number does not give real number. That’s the problem
– Jefferson Quesado
you should check the delta value before continuing. If Δ = 0 there will only be a root If Δ < 0 , it will have no roots. If Δ > 0 , will have two different real roots.
– Caique Romero