Write C Program Solve Quadratic Equation X2 B X C 0 Given Coefficients B C Running Program Q43870736
Write a C program, to solve the quadratic equation ax2 + b x + c = 0 of given coefficients a, b and c. Whenrunning the program, it prompts for the input of coefficients a,b,cas floating numbers. After inputting three floating numbers, itcomputes and prints out the solutions, then prompts for anotherround of input. Your program will quit when getting input 0,0,0.Your program should handle four situations: (1) a=0, not aquadratic equation; (2) b2 – 4ac = 0, the equation hastwo equal roots; (3) b2 – 4ac < 0, the equation hascomplex roots; (4) b2 – 4ac > 0, the equation hasdistinct real roots. Your program should be robust for invalidinputs.
output:
Please enter the coefficients a,b,c:
1,2,1
The equation has two equal real roots:
-1.000000
Please enter the coefficients a,b,c:
1,2,2
The equation has two complex roots:
-1.000000+1.000000i -1.000000-1.000000i
Please enter the coefficients a,b,c:
2,6,1
The equation has two distinct real roots:
-0.177124 -2.822875
Please enter the coefficients a,b,c:
a,b,c
Invalid input
Please enter the coefficients a,b,c:
1,2
Invalid input
Please enter the coefficients a,b,c:
0,1,2
not a quadratic equation
Please enter the coefficients a,b,c:
0,0,0
Goodbye
Expert Answer
Answer to Write a C program, to solve the quadratic equation a x2 + b x + c = 0 of given coefficients a, b and c. When running the…
OR