Question: Exercise 3.2 Roots of Quadratic Equations Write a program to check the number of distinct real roots of a quadratic equation given its coefficients. Suppose

Exercise 3.2 Roots of Quadratic Equations Write a
Exercise 3.2 Roots of Quadratic Equations Write a program to check the number of distinct real roots of a quadratic equation given its coefficients. Suppose the quadratic equation is ax2 + bx + c = 0. The inputs to your program will be a, b, and c in order. Your program should then print the number of the distinct real roots of the equation. You can assume that input a, b, and c are integers, and a will never be 0. Hints: the number of distinct real roots of a quadratic equation can be determined by its discriminant b2 - 4ac. Sample test cases: Test case ID Inputs Outputs 1 2 1 2 3 D N Y N W 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!