1. Could anyone recommend a free Quadratic Problems (QP) solve which offers C API that I can use it in my C++ programs?
Thank you!
[/img]

2. ### Related Discussions:

3. Seems like you're a beginner in programming. For ease of use, use iostream and CMath.

float out=out1=out2=A=B=C=rt=0;
int im=0;

cout << "Enter A, B, C" << endl;
cin >> A >> B >> C;

if (4*A*C > B*B) {
im=1;
}

rt = sqrt(abs( (B*B) - (4*A*C)));
rt = rt/(2*A);

out = (-1*B);
out = out / (2*A);

if (im == 0 ) {
out1 = out - rt;
out2 = out + rt;

cout << "Your solutions are: " << out1 << " and " << out2 << endl;

} else {

cout << "Your solutions are: " << endl ;
cout << out << " + " << rt << "i" << endl;
cout << out << " - " << rt << "i" << endl;

}

I did not test this, but it should work, barring typos.

 Bookmarks
##### Bookmarks
 Posting Permissions
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement