I've been looking over this problem I have for my programming class, and quite honestly, I can't figure out how I should write this quadratic equation.
In case anyone reading this doesn't know, quadratic equation is :
x = (-b +- sqrt((b^2)-4ac))/2a
Now my question is, how would I put that into C++ in my program? (I haven't started it yet because I want to figure out how to write this equation into it first)
Well...that's what I can come up with so far...the handout from our teacher (I think) very vaguely explained how to code it if the discriminant (b*b - 4*a*c) < 0, so I just input it as I thought it would work.
If anyone could look over this and point out necessary adjustments I need to make, it would be much appreciated.
Well, I think I realized some stupid mistakes I made, but I'll just see what kind of input I get.