1.

Suppose you want to solve the quadratic equation ax2 + bx + c – 0 by an algorithm. quadratic_solve (a, b, c) — inputs : ? — outputs: ?You intend to use the formula and you are prepared to handle only real number roots. Write a suitable specification.

Answer»

1. Quadratic – solve (a, b, c)

2. – – inputs: b2 – 4 ac > = 0 where a, b, c are real numbers, a ≠ 0

3. – – outputs: and x2 are real numbers such that a(x1)2 + bx1 + c = 0 and a(x2)2 + bx2 + c = 0



Discussion

No Comment Found