Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to the quadratic equation. We know that in quadratic formula: if ax^2 + bx + c = 0, then x1 = [-b

Write a program to the quadratic equation. We know that in quadratic formula:

if ax^2 + bx + c = 0,

then x1 = [-b + sqrt(b^2 - 4ac)] / 2a

and x2 = [-b - sqrt(b^2 - 4ac)] / 2a

The program asks the user to enter coefficients a, b, and c, then solve for and display x1 and x2.

Don't forget to check if coefficient a is zero, then x1 = x2 = -(c / b).

Include math.h to use the sqrt() function.

This program is for the c language.

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_2

Step: 3

blur-text-image_step3

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

More Books

Students also viewed these Databases questions