how can i make a program that uses the quadratic formula in TURBO C????
^_^
How can i make a program that uses the quadratic formula in TURBO C????
If your quadric equation is ax2 + bx + C = 0 Than your program should be as below to find the value/s of X.
#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
#include%26lt;math.h%26gt;
void main()
{
clrscr();
float a,b,c,delta,x1,x2,sqrtdelta;
printf("Enter the Value of a : ");
scanf("%f",%26amp;a);
printf("Enter the Value of b : ");
scanf("%f",%26amp;b);
printf("Enter the Value of c : ");
scanf("%f",%26amp;c);
delta= b*b - 4*a*c;
sqrtdelta = sqrt(delta);
x1 = (-b + sqrtdelta)/(2*a);
x2 = (-b - sqrtdelta)/(2*a);
printf("The X1 : %f",x1);
printf("The X2 : %f",x2);
getch();
}
I think this enough for you. If you need any further help than try to contact me.
Bye.
Reply:Well tell the quadratic formula here someone will make it for you or try the pow and sqrt functions
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment