Question
!@#$% Your C program will do the following tasks: i. Prompt and obtain the coefficients a, b, and c ii. In order to determine whether
!@#$%
Your C program will do the following tasks: i. Prompt and obtain the coefficients a, b, and c
ii. In order to determine whether the roots are complex, it will calculate the quantity b2 4ac
iii. If this quantity is negative, then the program will print out the message "The roots are complex"
iv. If not, the program will calculate the two real roots of the quadratic equation as (b + (sqrt(b2 4ac))/2a and (b (sqrt(b2 4ac))/2a.
sample output:
Enter value for a:
Enter value for b:
Enter value for c:
Roots are: (((depends on values entered)))
Issue:
I have tried to do this project and regardless of what numbers I enter for a,b, and c, I get 0s for the roots in any of the situations in the project statement. also, the type is supposed to be double for the values but whenever i try that i get errors so i have left them as int for now. if someone could change them to type double and correct the issue that is giving me 0s everytime, that would be much appreciated.
Thanks!
My code:
#include
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