find the root of the equation ax2+bx+c=0

I want to find roots of the equation ax2+bx+c=0
searching different programs for quadratic equation I don't get the answer I want
for example input a=1,b=1,c=6
then answer should be x1=2 x2=-3
I find this using factorization

using this equation
http://schooltutoring.com/help/wp-content/uploads/2012/06/quadratic-equation-calculator.gif

I can not get the desire answer how to make a program that use factorization to find roots of equation.
1
2
#include <math.h>
pow( number , powerOf );

( a root is the denominator of a power eg sq root is 1/2 power or .5 power)

btw you should atleast post some code?
x1=2
x2=-3

corresponds to
a = 1
b = 1
c = -6

Note c is negative.
If c is +6, the roots are imaginary.
yeah but if it is +6 maybe b is 10 and then b²is > -1 * ( 4 * 1 * 6) =p
but I guess he could write his own code on roots/powers that would take into consideration of i ( √-1 )

and you could of always just put the formula here (even though most people already know it) instead of a link
-b± √( b²-4ac )
-------------------
.........2a...........
Last edited on
Topic archived. No new replies allowed.