Where error And why all looks like perfect?

#include
#include
using namespace std;

int main() {

float a, b, c, x1, x2, discriminant, realPart, imaginaryPart;
cin >> a >> b >> c;
discriminant = b*b - 4*a*c;

if (discriminant > 0) {
    x1 = (-b + sqrt(discriminant)) / (2*a);
    x2 = (-b - sqrt(discriminant)) / (2*a);
    cout  << x1 <<" "<<x2<< endl;
    
}

else if (discriminant == 0) {
    x1 = -b/(2*a);
    cout << "x1 = x2 =" << x1 << endl;
}

else {
    realPart = -b/(2*a);
    imaginaryPart =sqrt(-discriminant)/(2*a);
    cout << "x1 = " << realPart << "+" << imaginaryPart << "i" << endl;
    cout << "x2 = " << realPart << "-" << imaginaryPart << "i" << endl;
}

return 0;

}

hi @dheerajjha11111_bb855e8d7a52ef0d u r printing wrong messages, check this code and match woth yours

#include<iostream>
#include<cmath>
using namespace std;

int main() {
	int a,b,c,x1,x2;
	double d;
	cin>>a>>b>>c;
	d=b*b-4*a*c;

	if(d>0) {
          x1=((-b)+sqrt(b*b-4*a*c))/2*a;
		  x2=((-b)-sqrt(b*b-4*a*c))/2*a;
		  cout<<"Real and Distinct"<<endl;
		  cout<<min(x1,x2)<<" "<<max(x1,x2)<<" ";
	}
    else if(d==0){
		x1=(-b/2*a);
	    x2 = x1;
		cout<<"Real and Equal"<<endl;
		cout<<x1<<" "<<x2;
	}
	else{
		cout<<"Imaginary";
	}
	return 0;
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.