Before going to the program first let us understand what is a Quadratic Equation?
C program to find the roots of a quadratic equation using switch case: The below program ask the user to enter the value of a,b and c. Xhorse mvci driver windows 10. After getting the value from the user it will calculate on the basis of ‘Discriminant’ value using switch case. Find Roots of Quadratic Equation: C Program - Duration: 3:08. Technotip 1,580 views. Learn C language in 30 Minutes & Start Coding For Beginners in Hindi - Duration: 42:29.
Quadratic Equation:
A Quadratic Equation is any equation having the form:
where x represents an unknown, and a, b, and c represent known numbers such that a is not equal to 0. If a = 0 Komatsu d51 manual. , then the equation is linear equation, not quadratic.
![C++ C++](https://i.ytimg.com/vi/bNmAAKS-b-k/maxresdefault.jpg)
For Example,
For more understanding you can check out the following link:
Program code to find roots of Quadratic Equation:
Step by Step working of the above Program Code:
- First the computer reads the coefficients a , b and c from the user.
- Then it computes the value of determinant using the formula.
determinant=b*b-4*a*c;
- Then checks the determinant value is greater than , equal or less than to zero using if else if ladder.
- If the determinant value is greater than zero, then root1 and root2 value is calculated using the formula:
r1=(-b+sqrt(determinant))/(2*a)
r2=(-b-sqrt(determinant))/(2*a)
- If the determinant value is equal to zero, then root1 and root2 value is calculated using the formula:
r1=r2=-b/(2*a)
![Using Using](https://i.ytimg.com/vi/2Yq_v-9Y-2Q/maxresdefault.jpg)
- If the determinant value is less than zero, then root1 and root2 value is calculated using the formula:
C Program To Find Roots Of Quadratic Equation Using Functions
real=-b/(2*a)
Minecraft kill aura settings. imag=sqrt(-determinant)/(2*a)
C++ Program To Find Quadratic Equation
- Finally print the roots of the quadratic equation.