I have tried everything and answer is right each time I run code on my IDE by on submision of code it says wrong-answer for all three testcases .
Code Location - https://github.com/everythingProgrammer/JavaPrograms-/blob/master/RevisingQuadraticEquations.txt
Code
import java.text.DecimalFormat;
import java.lang.Math;
import java.util.;
public class Main {
public static void main(String args[])
{
Scanner sr = new Scanner(System.in);
int a = sr.nextInt();
int b = sr.nextInt();
int c = sr.nextInt();
int d = (bb) - (4ac);
double x , y =0.0;
DecimalFormat df = new DecimalFormat("#.##");
if(d > 0)
{
x = ((b*-1) + (Math.sqrt(b*b - 4*a*c)))/(2*a);
y = ((b*-1) - (Math.sqrt(b*b - 4*a*c)))/(2*a);
System.out.print("Real and Distict ");
System.out.println(" "+ df.format(y)+" "+df.format(x));
}
else if (d==0)
{
x = ((b*-1) + (Math.sqrt(b*b - 4*a*c)))/(2*a);
y = ((b*-1) - (Math.sqrt(b*b - 4*a*c)))/(2*a);
System.out.print("Two equal roots");
System.out.println(" "+df.format(y)+" "+df.format(x));
}
else if (d< 0 )
{
System.out.println("Imaginary roots ");
}
}
}