![]() ![]() Printf("Enter values of 'c' of quadratic equation (aX^2 + bX + c): ") ![]() Printf("Enter value of 'b' of quadratic equation (aX^2 + bX + c): ") Printf("Enter value of 'a' of quadratic equation (aX^2 + bX + c): ") #include įloat root1, root2, imaginary, discriminant After getting the value from the user it will calculate on the basis of ‘Discriminant’ value using switch case. The below program ask the user to enter the value of a,b and c. Case 1: (Discriminant 0)Ĭ program to find the roots of a quadratic equation using switch case: ![]() ![]() There are the following important cases of this formula. In algebra, a quadratic equation is an equation that can be rearranged in standard form as, ax2 + bx + c = 0īelow is a direct formula for finding the roots of the quadratic equation. Let see an example, Input : a = 1, b = -2, c = 1 Logic to find roots of quadratic equation in C programming. How to find all roots of a quadratic equation using if else in C programming. Write C program to find roots of quadratic equations using switch statements. We will write the C program to find all roots of a quadratic equation using switch case. In this blog post, we learn how to write a C program to find all roots of a quadratic equation using switch case?. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |