Unable to solve all test cases of question (Revising Quadratic Equations)

/* This is the code that I have written. It is satisfying some cases but unable to solve all testcases. */

#include< iostream>

#include< math.h>

using namespace std;

int main() {

int a,b,c;
cin>> a>> b>> c;
int d = b*b - 4*a*c;
if(d>0){
	cout<<"Real and Distinct"<<endl;
	int r1 = (-b + sqrt(d))/2*a;
	int r2 = (-b - sqrt(d))/2*a;
	if((r1)>(r2)){
		cout<<r2<<" "<<r1<<endl;
	}
	else{
		cout<<r1<<" "<<r2<<endl;
	}
}
else if(d=0){
	cout<<"Real and Equal"<<endl;
	int r = -b/(2*a);
	cout<< r <<" "<< r <<endl;
}
else{
	cout<<"Imaginary"<<endl;
}
return 0;

}

// Please tell me my mistake.

hello @arshia27
check now->

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.