Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 Solving quadratic equation Write a C program, named quadratice, to solve the quadratic equation ax+bx+c = 0 of given coefficients a, b and

image text in transcribed
Question 3 Solving quadratic equation Write a C program, named quadratice, to solve the quadratic equation ax+bx+c = 0 of given coefficients a, b and c. When running the program, it prompts for the input ol coefficients a, b, c as the float type numbers. After inputting three float numbers, it computes and prints out the solutions, then prompts for another round of inputting. Your program will quit when getting input 0,0,0. Your program should handle four situations: 1. a=0, not a quadratic equation; 2. b2 - 4ac = @, the equation has two equal roots; 3. b2 - 4ac e, the equation has distinct real roots. Your program should be robust for invalid inputs. The output formats of different coefficients should be as shown in the following test. public test gec quadratic.c -o quadratic quadratic Please enter the coefficients a,b,c 1,2,1 The equation has two equal real roots x-1.000000 Please enter the coefficients a,b,c 1,2,2 The equation has two complex roots real:-1.000000 imaginary:1.000000 Please enter the coefficients a,b,c 2,6,1 The equation has two distinct real roots xl:-0.177124 x2 :-2.822875 Please enter the coefficients a,b,c 0,1,2 input not a quadratic equation Please enter the coefficients a,b,c a,a,a

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

Has the priority order been provided by someone else?

Answered: 1 week ago

Question

Compare the current team to the ideal team.

Answered: 1 week ago