I'm about 3 weeks into a C++ class at high school and I'm stuck on this assignment.
The user is asked to enter 3 different numbers which are assigned to variables a, b, c, and the result of those numbers comes from the quadratic formula (only -b +..., leaving out -b - ...).
result = -b + sqrt(pow(b, 2) - 4*a*c)/ 2*a;
Thats all what I can come up with, and it's just not working out. I'll enter some numbers and the result is different than when I work it out on paper, and I know I'm not making a mistake on paper. Also, sometimes the result comes out to be: -1.#IND.
This assignment is due tomorrow...
Thanx in advance,
-YB
The user is asked to enter 3 different numbers which are assigned to variables a, b, c, and the result of those numbers comes from the quadratic formula (only -b +..., leaving out -b - ...).
result = -b + sqrt(pow(b, 2) - 4*a*c)/ 2*a;
Thats all what I can come up with, and it's just not working out. I'll enter some numbers and the result is different than when I work it out on paper, and I know I'm not making a mistake on paper. Also, sometimes the result comes out to be: -1.#IND.
This assignment is due tomorrow...
Thanx in advance,
-YB