В чём ошибка? язык Си
#include
#include
#include
#include
int main ()
{
double a,b,c, D, x1, x2;
printf("Vvedite a:");
scanf("%f", &a);
printf ( "Vvedite b:");
scanf("%f", &b);
printf("Vvedite c:");
scanf("%f", &c);
if (a==0.0) printf("\a\n уравнение не имеет корней! ");
else
{
D=(b^2)-4*a*c;
if (b==0.0 && c==0.0) x1=0.0;
printf("уравнение имеет один корень: x=%f", x1);
}
else
{
x1=(-b - sqrt(d))/ (2*a);
x2=(-b + sqrt(d))/ (2*a);
printf ("уравнение имеет два корня: \n x1=%f\n x2=%f" , x1, x2);
}
}
getch();
return 0;
}