Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Tagged as

Go to top

A simple program to solve quadratic equations with

, 8 Nov 2010
Simple and prints imaginary roots too!float a,b,c,x1,x2,d,dsq;printf("ax^2 + bx + c = 0");printf("\nEnter a,b,c separated by commas : \n");scanf("%f,%f,%f",&a,&b,&c);d = b*b-(4*a*c);if(d>=0){dsq=sqrt(d);x1 = (-b+dsq)/(2*a);x2 = (-b-(dsq))/(2*a);printf("\nRoot 1 : %f\nRoot 2...
No downloads associated with this content

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anshul R
Student
India India
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 8 Nov 2010
Article Copyright 2010 by Anshul R
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid