Beginner question about quadratic equation calculator
I made a quadratic equation calculator but it doesn't work. Any ideas?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace quadratic
{
class quadratic
{
static void Main(string[] args)
{
int a, b, c;
double x1, x2;
Console.Write("Please enter the value of A: ");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.Write("Please enter the value of B: ");
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.Write("Please enter the value of C: ");
c = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
x1 = (-a + Math.Sqrt(b * b - 4 * a * c))/(2 * a);
x2 = (-a - Math.Sqrt(b * b - 4 * a * c))/(2 * a);
Console.WriteLine(x1);
Console.WriteLine(x2);
}
}
}