Scanner scn=new Scanner(System.in);
int a=scn.nextInt();
int b=scn.nextInt();
int c=scn.nextInt();
double root1;
double root2;
if (b*b-4*a*c>0) {
System.out.println("Real and Distinct");
root1= (-b + Math.sqrt(b*b - 4*a*c))/(2*a);
System.out.print(root1);
root2=(-b - Math.sqrt(b*b - 4*a*c))/(2*a);
System.out.print(root2);
}
if (b*b-4*a*c==0) {
System.out.println("Real and Equal");
root1 = root2 = -b / (2 * a);
System.out.print(root1);
System.out.print(root2);
}
if(b*b-4*a*c<0) {
System.out.println("Imaginary");
double x = -b / (2 *a);
double y = Math.sqrt(-b*b - 4*a*c) / (2 * a);
root1=x+y;
root2=x-y;
System.out.print(root1);
System.out.print(root2);
}
}
}
what is wrong in this code???