My code is passing 2 test cases only not passing the 3rd test case Why? ... What is the mistake in the code?

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();

	int determinent  = (b*b)-(4*a*c);

	if(determinent>0){
		int root1= (int) (-b + Math.sqrt(determinent)) / (int) (2 * a);
		int root2= (int)(-b - Math.sqrt(determinent)) /  (int)(2 * a);

		System.out.println("Real and Distinct");
		System.out.println(root2 + " "+ root1);
	}
	 else if(determinent == 0) {
        int root1 = -b / (2 * a);
	    int root2 = -b / (2 * a);

	 	System.out.println("Real and Equal");
		System.out.println(root2 + " "+ root1);

	 }
	else {
		System.out.println();
	}
	

}

}

HI @LakshmiPrasanna0303,
you should system.out.println(“Imaginary”) in the last system.out.println in the else section of the code.

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.