Questions 2 Write a C program that computes the roots of a quadratic equation. This program should compute values for th
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Questions 2 Write a C program that computes the roots of a quadratic equation. This program should compute values for th
Questions 2 Write a C program that computes the roots of a quadratic equation. This program should compute values for the THREE cases: i) Real and distinct roots Real and equal roots 111) Complex roots HINT: use conditional expressions to aid in the computation of the three cases above. For the case of complex roots, include the "Pº character in your display to carter for the <i> in the imaginary part of complex numbers. Split your program into two files: quadrafile.h and assignqn2.c The header file quadrafile.h should contain code for a function definition quadSolve(). This function returns the roots of a quadratic equation given its arguments as a, b, and c, which are the three coefficients. HINT: use the quadratic formula; use the sqrt() and fabs() math.h functions where appropriate. Finally, implement the above code in the assignqn2.c file in order to test your program with the quadratic equations given by their coefficients (a, b, c) respectively as: {1.-4. 4; {1, 6.0) 11.-5.6) 11. 2. 2) {2. 3. 47 USE the scanf() function to enter the required coefficients directly via TERMINAL in vs code. CU 00
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!