Revising Quadratic Equations Search Contents.. search < Dashboard

#include
using namespace std;
#include<math.h>
int main() {
int a,b,c;
cin>>a>>b>>c;
int root,root1,root2;

int d=b*b-4*a*c;
if(d==0){
    root=-b/(2*a);
}
if(d>0){
    root1=-b+sqrt(d)/(2*a);
    root2=-b-sqrt(d)/(2*a);
}
//yet d is negative 
d<0?cout<<"Imaginary"; : d==0?cout<<"Real and Equal"; cout<<endl<<root; :cout<<"Real and Distinct";cout<<endl<<root1<<" "<<root2;
return 0;

}

something went to be wront in my code of
ternary operator statement line

in ternary operator only one statement is executed
also in that statement no need to put ; (semicolon)