Click here to Skip to main content
11,565,672 members (48,284 online)
Click here to Skip to main content

A simple program to solve quadratic equations with

, 10 Jun 2010 CPOL 20.8K 3
float a,b,c,x1,x2,d;printf("ax^2 + bx + c = 0");printf("\nEnter a,b,c separated by commas : \n");scanf("%f,%f,%f",&a,&b,&c);d = pow(b,2)-(4*a*c);if(d>=0){x1 = (-b+sqrt(d))/(2*a);x2 = (-b-(sqrt(d)))/(2*a);printf("\nRoot 1 : %f\nRoot 2 : %f",x1,x2);}if(d<0){d =...
This is an old version of the currently published tip/trick.

This article is still being written and is not currently available for general viewing.

Please go to the Programming Tips Table of Contents to view the list of available articles in this section.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150624.2 | Last Updated 10 Jun 2010
Article Copyright 2010 by Anshul R
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid