Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with this little program
#1
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

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]
Reply


Messages In This Thread
Need help with this little program - by Clones - 01-17-2012, 03:22 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)