166k views
0 votes
If you do not have time to do this exercise in class, do it at home as a homework.

a. Write a C function that finds the roots of a quadratic equation. The standard form of a quadratic equation is: ax2+bx+c=0, where a,b and c are real numbers and a!=0.
b. The term b2−4ac is known as the discriminant of a quadratic equation. It tells the nature of the roots. If the discriminant is greater than 0 , the roots are real and different. If the discriminant is equal to 0 , the roots are real and equal. If the discriminant is less than 0 , the roots are complex and different.

User Bazo
by
7.8k points

1 Answer

4 votes

Final answer:

A quadratic equation can be solved using the quadratic formula. The discriminant of the quadratic equation determines the nature of its roots.

Step-by-step explanation:

A quadratic equation is an equation of the form ax²+bx+c=0, where a, b, and c are real numbers and a is not equal to 0. To find the roots of a quadratic equation, we can use the quadratic formula:

x = (-b ± √(b²-4ac)) / (2a)

The term b²-4ac in the quadratic formula is known as the discriminant. It tells us the nature of the roots: if the discriminant is greater than 0, the roots are real and different, if the discriminant is equal to 0, the roots are real and equal, and if the discriminant is less than 0, the roots are complex and different.

User Alexey Frunze
by
8.7k points

Related questions