Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
15.8k views
in Electronics by (53.2k points)

Write the C program to find the roots of a quadratic equation ax2 + bx + c = 0 using switch statement.

1 Answer

+2 votes
by (52.3k points)
selected by
 
Best answer

Output:
Enter the values of A; 1 Enter the values of B : 3 Enter the values of C: 8 RESULT:
Roots are complex/imaginaiy number. Roots of quadratic equation are:
Root-1 -1.500*2.398!
Root-2 -1.500-2.398i
Enter the values of A: 2 Enter the values of B : 4 Enter the values of C: 2 RESULT:
Both roots are real numbers and equal. Root of quadratic equation is:
Root-1 = Root-2 = -1.000
Enter the values of A: o Enter the values of B : 5 Eater the values of C : 8 RESULT:
Equation is linear.
Eater the values of A: 3 Enter the values of B : 8 Enter the values of C : 2 RESULT:
Roots are real numbers and unequal. Roots of quadratic equation are: Root-i = -0.279 , Root-2 = -2.387

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...