Real roots of a quadratic equation

From Programming In C

Exercise 2.1

Write a C program that reads in 3 real numbers, a, b and c that are the coefficients of a quadratic equation

ax2 + bx + c = 0

The program should calculate the 2 roots of the equation assuming that they are both real. Test your program with the following values

  1. a = 47.2, b = -148.1, c = 72.6
  2. a = -19, b = 67, c = 82

Check your answers with a demonstrator


Next exercise

Return to the course summary

phy225: Course Details