#include<iostream.h>
#include<math.h>
void main()
{
int x,x1,d,d1,a,b,c;
cout<<"enter a,b,c of quadratic eqution (ax2+ bx +c) :";
cin>>a>>b>>c;
d=b*b-4*a*c;
d1=sqrt(d);
x=(-b+d1)/2*a;
x1=(-b-d1)/2*a;
cout<<"roots of the quadratic eqution are :";
cout<<x<<" "<<x1;
}
No comments:
Post a Comment