# Real roots of a quadratic equation

### From Programming In C

[edit]

### 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

*a*x

^{2}+

*b*x +

*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

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

Check your answers with a demonstrator