Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A quadratic equation can have either one or two distinct real or complex roots depending upon nature of discriminant of the equation. Where discriminant
A quadratic equation can have either one or two distinct real or complex roots depending upon nature of discriminant of the equation. Where discriminant of the quadratic equation is given by A = b-4ac Depending upon the nature of the discriminant, formula for finding roots can be given as: Case 1: If discriminant is positive (flag=1). Then there are two real distinct roots given by. -b+ -b-A and 2a 2a Case 2: If discriminant is zero (flag=0). Then it have exactly one real root given by. b 2a Case 3: If discriminant is negative (flag=-1). Then it will have two distinct complex roots given by. -b -b +i and i 2a 2a 2a 2a Based on the value of flag of determinant, write a complete C program using switch statement to determine and print out the roots of the polynomial. [7 marks]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started