title: about the IF statements
body: <p>When I enter the values for a, b c which are 1.0, 3 1 the answer should be only , saying that The roots are -0.381 and -2.62803. I get both of the answers and I also get "There are no real roots". I think I am using IF statements in a wrong way. Please be kind enough to explain me where I go wrong.</p>
  
  <pre><code>import java.util.Scanner;
  public class sha {
  public static void main(String[] args ){
  Scanner input = new Scanner (System.in);
  
  System.out.println("Enter a , b , and c : ");
  double a = input.nextDouble();
  double b = input.nextDouble();
  double c = input.nextDouble();
  
  // the equations 
  double discriminant = Math.pow (b , 2) - 4 * a * c;
  double root1 = (-b + Math.sqrt(discriminant))/2 * a ;
  double root2 = (-b - Math.sqrt(discriminant))/2 * a ;
  
  if (discriminant &gt; 0 ){
  System.out.printf("The roots are %8.6f and %8.6f ", root1, root2);
  }
  if (discriminant == 0 ){
  System.out.print("The root is  " +  root1);
  }
  else  {
  System.out.print("There are no real roots ");
  }
  
  
  
  
  }
  }
  </code></pre>