English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

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 - Computer Science

Advertisements
Advertisements

Question

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.

x = `(-b ± sqrt(b^2) - 4ac)/(2a)`

Short Note

Solution

  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
shaalaa.com
Algorithmic Problems
  Is there an error in this question or solution?
Chapter 6: Specification and Abstraction - Evaluation - Section - D [Page 87]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 6 Specification and Abstraction
Evaluation - Section - D | Q 2. | Page 87
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×