What is wrong in code?

#include
#include<math.h>
using namespace std;
int main()
{
double a,b,c;
cin>>a>>b>>c;
if(a,b,c>0){

double d;
d=(b*b)-(4*a*c);                             

double r1,r2;
r1=(-b+sqrt(d))/(2*a);
r2=(-b-sqrt(d))/(2*a);
double first,second;
if(r1>r2)
{
first=r1;
second=r2;
}
else
{
first=r2;
second=r1;
}
if(d>0)
{

    cout<<"Real and Distinct"<<endl;
    cout<<first<<" "<<second<<endl;
}
if(d==0)
{
    
    
    cout<<"Real and Equal"<<endl;
    cout<<first<<" "<<second<<endl;
}
if(d<0)
{

    cout<<"Imaginary"<<endl;
    
}
}
else
cout<<"negative";
return 0;

}

hello @sidd27
a) the if condition where u are checking if(a,b,c>0 ) is wrong.

coefficient can be negative as well.

b)first check discriminant and then after find the roots(if real).

also pls save ur code here- > https://ide.codingblocks.com/
and share its link with me so that i can make changes

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.