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

Tagged as

A simple program to solve quadratic equations with

, 8 Nov 2010 CPOL
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...

Revisions


  

Compare Revision Minor Date Status Editor
4 - publicly available No 8-Nov-10 6:17 Available Anshul R
3 No 8-Nov-10 6:16 Composing Anshul R
2 No 10-Jun-10 7:47 Composing Anshul R
1 No 10-Jun-10 7:43 Composing Anshul R

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 | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 8 Nov 2010
Article Copyright 2010 by Anshul R
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid