I wrote code for finding the roots of a quadratic formula in Java. However, I get the error that I'm missing a semi-colon in line 6, even though I have one there. What's going on?
public class Lab2{
public static void main (String[] args){
double a = 1;
double b = 2;
double c = 4;
double d = (math.pow(b, 2))-(4*a*c));
if (d < 0)
{
String.out.println("There are no real roots.");
} else if (a == 0) {
x3 = (-1)*c*b;
String.out.println("The root is " + x3);
} else if (a != 0) {
x1 = (((-1)*b) + (d))/(2*a);
x2 = (((-1)*b) - (d))/(2*a);
String.out.println(" The roots are " + x1 + " and " + x2 + ".");
}
}
}