REVISING QUADRATIC EQUATIONS

import java.util.;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
if (a == 0)
{
System.out.println(“Invalid”);
return;
}
double d = Math.pow(b,2) - 4
a*c;
double sq = Math.sqrt(d);

     if (d > 0) 
     { 
        System.out.println("Real and Distinct "); 
  
        System.out.println(((int)(-b - sq) / (2 * a)) + " " + (int)((-b + sq) / (2 * a))); 
     } 
     else 
     { 
        System.out.println("Roots are complex \n"); 
  
        System.out.println( -(int)b / ( 2 * a ) + " + i"  + sq + " "  + -(int)b / ( 2 * a ) + " - i" + sq); 
     }

}

}