How to write quadratic equation...by c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to write quadratic equation...by c++

14th Jan 2017, 9:25 PM
Kibrom Tsegay
Kibrom Tsegay - avatar
2 Answers
+ 1
That's easy. Just include the cmath header, get a, b, and c from the user and get two results, like so: result1 = (-b + sqrt(pow(b, 2) - 4 * a * c)) / (2 * a) Do the same for result2, except with a minus.
14th Jan 2017, 10:03 PM
DaemonThread
DaemonThread - avatar
0
Thanks a lot
25th Jul 2017, 4:46 PM
lam