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))/2a);
root2 = ((-b-Math.sqrt(determinant))/2a);
System.out.println(“Real and Distinct”);
System.out.println(root1+" "+root2);
}
else if(determinant == 0)
{
root1 = root2 = (-b/(2a));
System.out.println(“Real and Same”);
System.out.println(root1+" “+root2);
}
else
{
System.out.println(”");
}
}
}
my first two test cases are failling