solve the quadratic equation by taking three input values with output in c++ program
Answers
Answered by
0
Explanation:
sorry bhai dont know but please follow me i will follow back to you
Answered by
0
Answer:
#include<iostream>
#include<conio.h>
#include<math.h>
using namespace std;
int main ()
{
float a,b,c;
double x,y;
cout<<"Enter three values:";
cin>>a>>b>>c;
if(b*b-4*a*c>=0)
{
x=(-b+sqrt(b*b-4*a*c))/2*a;
y=(-b-sqrt(b*b-4*a*c))/2*a;
cout<<"\nRoots of the equation are "<<x<<" and "<<y;
}
else
cout<<"\nSorry the roots are not real";
return 0;
}
Explanation:
Similar questions