velop a C program that computes the different roots in a quadratic equation, aX + bX2=0. r = -b ± √ (b2 – 4ac) , r1 is the root when the + is used in the equation and r2 is the root when 2a the – is used. The roots r1 and r2 can only be computed when the discriminant (b2 – 4ac) is greater than the zero else the quadratic equation does not have any roots and therefore the program should display “no roots”. NOTE: sqrt is a built in function in C to extract the roots. The program will prompt to input the values of a, b and c and output the roots r1 and r2 or no roots at all. Check your answer manually. 2.) Implement a program usi
1.)Implement a program using the if-else selection structure.
Develop a C program that computes the different roots in a quadratic equation, aX + bX2=0.
r = -b ± √ (b2 – 4ac) , r1 is the root when the + is used in the equation and r2 is the root when
2a the – is used. The roots r1 and r2 can only be computed when the discriminant
(b2 – 4ac) is greater than the zero else the quadratic equation does not have any roots and therefore the program should display “no roots”.
NOTE: sqrt is a built in function in C to extract the roots. The program will prompt to input the values of a, b and c and output the roots r1 and r2 or no roots at all. Check your answer manually.
2.) Implement a program using the if-else selection structure.
Input two numbers. Determine and print the larger number, smaller number. Also, print the two numbers in ascending and descending order.
Test data:
Enter 1st number: 4 /*inputs */
Enter 2nd number: 2
Smaller number : 2 /*output */
Larger number : 4 /*output */
Ascending order : 2,4 /*output */
Descending order: 4,2
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)