Related to topic Revising Quadratic Equation

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 = (b
b) - (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 ");
  }
}

}

Hey @ranaabhinav50
The output format needs to be followed strictly while submitting the problems, otherwise it would give wrong ansswer even when the logic is correct.
It should be
“Imaginary” instead of "Imaginary roots "
“Real and Equal” instead of “Two equal roots”

Keep this in mind from next time.

Hey Abhinav, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.

Thank you.
I’ll keep that in mind from next time.