Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Limad
SUBMITTED BY:
Guest
DATE:
Dec. 30, 2013, 3:29 a.m.
FORMAT:
Text only
SIZE:
839 Bytes
Raw
Download
Tweet
HITS:
2987
Go to comments
Report
#include<conio.h>
#include<stdio.h>
#include<math.h>
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();
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus