#include
using namespace std;
#include
#include<math.h>
int main() {
float a,b,c,d,f,k;
cin>>a>>b>>c;
d=(b2)-(4ac);
if(d==0)
{cout<<“Real and equal”<<endl;
k=((-b)/(2a));
cout<<k<<""<<k;}
else if(d>0)
{cout<<“Real and Distinct”<<endl;
f=sqrt(d);
cout<<(-b-f)/(2a)<<" "<<(-b+f)/(2a);
}
else{
cout<<“Imaginary”;
}
return 0;
}
Not all test cases passed
Hello @lakshit,
From next time, please share your code using Online Coding Blocks IDE:https://ide.codingblocks.com/
Steps:
- Paste your code there.
- Save your code.
- Share the URL generated
The way you have shared it is introducing many syntax errors to it.
Now, coming back to your question:
- The formula for d is wrong.
- The statements in the output are case sensitive
Hope, this would help.
Give a like if you are satisfied.
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.