I am beginner to c++, I want to make a program for Quadratic formula, only the positive part, but I can't make it.. I am trying this one
quadratic formula:
http://www.regentsprep.org/Regents/math/...adLe21.gif
please do corrections in it and help me
quadratic formula:
http://www.regentsprep.org/Regents/math/...adLe21.gif
Code:
#include<math.h>
#include<conio.h>
#include<stdio.h>
void main()
{
int a,b,c,s; float x, sq;
printf("\n Enter Values For a, b & c: ");
scanf("%d %d %d",&a,&b,&c);
s=b*b-1*4*a*c;
sq=pow(s,1/2);
x=(-1*b+s)/2*a;
printf("\n Positive solution of given quadratic equation is: %f",x);
getch();
}
please do corrections in it and help me
[url=http://myurl.pk/BLgzA][/url]