#include
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
int z;
z= bb - 4ac;
int ans=0;
int inc=1;
while(ansans<=z){
ans=ans+inc;
}
ans=ans-inc;
int rootz= ans;
int x1= (-b-rootz) / (2a);
int x2= (-b+rootz) / (2a);
if(z>0){
cout<<" Real and distinct “<<endl;
cout<<x1<<” “<<x2<<endl;
}
if(z=0){
cout<<” Real and equal “<<endl;
cout<<x1<<” “<<x2<<endl;
}
if(z<0){
cout<<” Imaginary "<<endl;
}
return 0;
}
I am running this code on my text editor sublime text and its working perfectly fine. But its not working here despite the fact that on compiling I am getting the right output.Please help me
@shresth_2000
there are few mistakes in your code
- for z>0 print “Real and Distinct” D of distinct should be capital and there should not be any space in the beginning
- check line 21 it should be if(z==0) “==” not “=”
3)for z==0 print “Real and Equal” E of equal should be capital and there should not be any space in the beginning. - for z<0 print “Imaginary” there shouldn’t be any space in the beginning.