The endl function is not working in the problem IDE while it is working on the coding blocks IDE.
Endl not working
Hi Dhruv, please mention the links where it is not working, and the corresponding code as well. We’ll see to it.
Hey Dhruv, endl is used just to shift the cursor to the new line and its working fine in the code that’s link you have shared here.
But then why are two of my testcases not working in Revising Quadratic Equations( https://online.codingblocks.com/player/13324/content/4699?s=2154) when I run the same code?
Hey Dhruv, that’s because there is a mistake in your code, when you are checking if a number is equal to 0 or not then condition should be if(num==D)
you can write it as if(num=D)
because ‘=’ is assignment operator.
Apart from that even if the roots are equal then also you are supposed to print both the roots.
else if (D==0){
cout<<“Real and equal”<<endl;
cout<<(-b)/(2a)<<" "<<(-b)/(2a)<<endl;
}