title: Finding roots of quadratic equation
body: <p>I have this code so far but every time i run and put the three numbers in a get the roots are NaN can some one please help or point me to where i went wrong.</p>
  
  <pre><code> import java.util.Scanner;
  
   class Quadratic {
     public static void main(String[] args) {
  
     System.out.println("Enter three coefficients");
     Scanner sc = new Scanner(System.in);
     double a = sc.nextDouble();
     double b = sc.nextDouble();
     double c = sc.nextDouble();
     double root1= (-b + Math.sqrt( b*b - 4*a*c ) )/ (2*a);
     double root2= (-b - Math.sqrt( b*b - 4*a*c ) )/ (2*a);
     System.out.println("The roots1 are: "+ root1);
     System.out.println("The roots2 are: " + root2);
  
  
       } 
     }
  </code></pre>