I can’t find any error and my first two test cases are passes. I have no idea why third case is not working.
#include
#include
using namespace std;
int main()
{
int a,b,c;
cin >> a >> b >> c;
double d = pow(b,2)-(4ac);
double e = (-b+sqrt(d))/(2a);
double f = (-b-sqrt(d))/(2a);
if(d==0){
cout << "Real and Equal\n" << e << " " << e;
}
else if (d>0){
cout << "Real and Distinct\n" << e << " " << f;
}
else if (d<0) {
cout << "Imaginary\n";
}
return 0;
}