### HELP HELP

This is a big one and I don't understand

Write a C++ function named quadratic which has parameters a,b, and c of type int which calculates only double?
Write a C++ function named quadratic which has parameters a,b, and c of type int which calculates only double real roots of quadratic equations according to the formula:

r1=-b+Sqrt(b^2-4ac)/(2a)), r2=-b- Sqrt(b^2-4ac)/(2a))

The two real roots are passed back to the caller via two parameters r1 and r2 of type float. When quadratic cannot calculate two real roots, it prints out the appropriate error message and returns -1 to the caller as a warning not to use the values of the roots. When it can calculate two real solutions, it returns 1 to the caller to indicate success.
You can start by writing the signature of the function, then we can look at filling it in.
 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455`` ``````/* quad.c * ---------- * Quadratic Equation Problem Phase #4. Created by Usandfriends. */ #include //include #include "genlib.h" #include "simpio.h" #include "math.h" main() { float answer1,answer2,a,b,c,bsq,fac,ta,nob,lin; //assign variables printf ("Quadratic Equation Problem Phase #4.\n"); //Get Numbers printf ("Enter \"a\" value. "); a=GetInteger(); printf ("Enter \"b\" value. "); b=GetInteger(); printf ("Enter \"c\" value. "); c=GetInteger(); bsq=b*b; //initialization fac=4*a*c; ta=2*a; nob=-1*b; lin=-1*(c/b); if (bsq
That's not a function, that's an entire program. But, it doesn't declare a return type for main or have a return statement. And it's written in C on a C++ board. :p
Do you understand what a function is? And if you know that, do you understand how to code one in C or C++?
Topic archived. No new replies allowed.