Quadratic roots revisited

From Programming In C

Exercise 3.3

For exercise 2.1 you wrote a program that calculated the real roots of a quadratic equation. You were given test values that were guaranteed to give real results. Write a program that can handle equations with complex roots.

Hint: The square root of a negative number is i times the square root of the absolute value of the number (where i is the square root of minus 1).


Return to course summary

phy225: Course Details

general


compilers


2011-12 assessments


past exam papers

  • 2008-9 (http://physics-database.group.shef.ac.uk/exampapers/2008-09/PHY225%20LT.pdf)
  • 2009-10 (http://physics-database.group.shef.ac.uk/exampapers/2009-10/PHY225%20Exam%20Sem%201%202009-10.pdf)
  • 2010-11 (http://physics-database.group.shef.ac.uk/exampapers/2010-11/PHY225_10_11.pdf)