#include #include #include void main() { float a,b,c,d; printf(" Nhap a,b,c:"); scanf("%f%f%f",&a,&b,&c); if(a==0)//bx+c=0 if(b==0)//c=0 if(c==0) printf("\n VSN!"); else printf("\n VN!"); else printf("\n PT co nghiem duy nhat:x=%6.2f\n",-c/b); else//a!=0 { d=b*b-4*a*c; if(d==0) printf("\n Nghiem kep:x1=x2=%6.2f",-b/(2*a)); else//d!=0 if(d>0) printf("\n Co hai nghiem la x1=%6.2f va x2=%6.2f",(-b+sqrt(d))/(4*a), (-b-sqrt(d))/(4*a)); else//d<0 printf("\n PTVN!"); } getch(); }