import java.io.*;
class Quadratic{
public static void main(String[] args) throws IOException{
DataInputStream in=new DataInputStream(System.in);
System.out.println("\nQUADRATIC EQUATION aX^2+bx+c :");
System.out.print("\nENTER VALUE FOR a : ");
int a = Integer.parseInt(in.readLine());
System.out.print("ENTER VALUE FOR b : ");
int b = Integer.parseInt(in.readLine());
System.out.print("ENTER VALUE FOR c : ");
int c = Integer.parseInt(in.readLine());
double temp;
temp = (b * b) - (4 * a * c);
if ( temp > 0 )
{
double Root1 = (- b + Math.sqrt(temp)) / (2 * a);
double Root2 = (- b - Math.sqrt(temp)) / (2 * a);
System.out.println("\nTHE ROOTS ARE " + Root1 + " AND " + Root2);
}
else if ( temp == 0 )
{
double root = - b / (2 * a);
System.out.println("\nTHE ROOTS ARE " + root + " AND " + root );
}
else if ( temp < 0 )
{
System.out.println("\nTHE ROOTS ARE IMAGINARY ");
}
}
}
class Quadratic{
public static void main(String[] args) throws IOException{
DataInputStream in=new DataInputStream(System.in);
System.out.println("\nQUADRATIC EQUATION aX^2+bx+c :");
System.out.print("\nENTER VALUE FOR a : ");
int a = Integer.parseInt(in.readLine());
System.out.print("ENTER VALUE FOR b : ");
int b = Integer.parseInt(in.readLine());
System.out.print("ENTER VALUE FOR c : ");
int c = Integer.parseInt(in.readLine());
double temp;
temp = (b * b) - (4 * a * c);
if ( temp > 0 )
{
double Root1 = (- b + Math.sqrt(temp)) / (2 * a);
double Root2 = (- b - Math.sqrt(temp)) / (2 * a);
System.out.println("\nTHE ROOTS ARE " + Root1 + " AND " + Root2);
}
else if ( temp == 0 )
{
double root = - b / (2 * a);
System.out.println("\nTHE ROOTS ARE " + root + " AND " + root );
}
else if ( temp < 0 )
{
System.out.println("\nTHE ROOTS ARE IMAGINARY ");
}
}
}