Two test cases are failing

Scanner scn = new Scanner(System.in);
double a = scn.nextInt();
double b = scn.nextInt();
double c = scn.nextInt();
double root1,root2;
double determinant = bb-4ac;
if(determinant>0)
{
root1 = ((-b+Math.sqrt(determinant))/2
a);
root2 = ((-b-Math.sqrt(determinant))/2a);
System.out.println(“Real and Distinct”);
System.out.println(root1+" "+root2);
}
else if(determinant == 0)
{
root1 = root2 = (-b/(2
a));
System.out.println(“Real and Same”);
System.out.println(root1+" “+root2);
}
else
{
System.out.println(”");
}
}

}
my first two test cases are failling

Here your variable is double but you’re taking integer input. Make it scan.nextDouble()

print the smaller root first

You have to print “Real and Equal”

Here you have to print “Imaginary”

And since roots are of type double, your answer will have a decimal which you will have to remove. For example, instead of 4, it will print 4.0

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.