Challenge 6 Problem

My code is :-

import java.util.Scanner;

import java.lang.Math;

public class Main {

public static void main(String args[]) {
	Scanner scn=new Scanner(System.in);
	int a=scn.nextInt();
	int b=scn.nextInt();
	int c=scn.nextInt();
	if(a<=100&&a>=-100&&b<=100&&b>=-100&&c<=100&&c>=-100){
		int D=b*b-4*a*c;
	int x,y;
	if(D>0) {
		System.out.println("Real and Distinct");
		x=(-b+(int)Math.sqrt(D))/(2*a);
		y=(-b-(int)Math.sqrt(D))/(2*a);
		if(x>y) {
			System.out.print(+y);
			System.out.print(" "+x);
		}
		else {
			System.out.print(+x);
			System.out.print(" "+y);
		}
	}
	else if(D==0) {
		System.out.println("Real and Equal");
		x=-b/(2*a);
		System.out.print(+x);
		System.out.print(" "+x);
	}
	else{
		System.out.println("Complex Roots");
	}
	}
	
}

}
and the output is same as shown in the problem. It is still not submitting.

@VinayakSingh11111 reviewing it buddy!

@VinayakSingh11111 bro i have accessed your submission you have to print “Imaginary” instead of complex root, pfa the code below.
And mark the doubt as resolved buddy and rate full!

import java.util.;
public class Main {
public static void main(String args[]) {
Scanner scn=new Scanner(System.in);
int a=scn.nextInt();
int b=scn.nextInt();
int c=scn.nextInt();
int D=b
b-4ac;
int x,y;
if(D>0) {
System.out.println(“Real and Distinct”);
x=(-b+(int)Math.sqrt(D))/(2a);
y=(-b-(int)Math.sqrt(D))/(2
a);
if(x>y) {
System.out.print(+y);
System.out.print(" “+x);
}
else {
System.out.print(+x);
System.out.print(” “+y);
}
}
else if(D==0) {
System.out.println(“Real and Equal”);
x=-b/(2*a);
System.out.print(+x);
System.out.print(” "+x);
}
else{
System.out.println(“Imaginary”);
}
}
}

It is still not working.

@VinayakSingh11111 bro that just copy pasting change the formatting, so you also post your code in ide like below:-

Here is the corrected code and mark the doubt resolved:-

@VinayakSingh11111,

Is your doubt resolved or are you still not able to submit? https://ide.codingblocks.com/s/251997 Here is correct code. If you have any further doubts, I will be happy to solve your queries.

It is resolved. Thank you for the assistance.

@VinayakSingh11111 Cool bro!