I need to code y= (-b + (b^2 – 4ac)^1/2 )/2a

Variables a,b,c,and y are of type float.

And for this code the square root is exactly the same as it is IRL, like Sqrt 16=4

Thanks alot :)

Printable View

- 02-17-2011newbwithC++Coding help.
I need to code y= (-b + (b^2 – 4ac)^1/2 )/2a

Variables a,b,c,and y are of type float.

And for this code the square root is exactly the same as it is IRL, like Sqrt 16=4

Thanks alot :) - 02-17-2011laserlight
So, what have you tried?

- 02-17-2011newbwithC++
idk how to code it, so i haven't tried anything!!

- 02-17-2011laserlight
Start with showing us how you would write the expression (b^2 – 4ac) as C++ code. If you cannot do that, then you need to re-read your learning material.

- 02-17-2011codeprada
fairly simple...break it up into parts. like for instance code the parenthesis first then move outwards till you've finished it.