import java.util.*;
import java.lang.*;
class Rextester
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
double a,b,c,x,y;
System.out.println("Enter the three coefficients");
a=sc.nextDouble();
b=sc.nextDouble();
c=sc.nextDouble();
x=(-b+Math.sqrt(b*b-4*a*c))/(2*a);
y=(-b-Math.sqrt(b*b-4*a*c))/(2*a);
System.out.println("roots are"+x+"and"+y);
}
}
|