+ 1
Write a program to solve the equation y=(a*x*x)+(b*x)+c
2 Respostas
+ 3
you are missing "home" from your tags.
Take your math book and look at the end of the equation chapter. They usually include some code in Pascal or some other antiquity, to show the book is cool while it is not...
0
*solution in Java*
public static int[] class giveAns(int a, int b, int c, int y){
c -= y;
a /= a;
b /=a;
c /=a;
int d = (b*b) - (4*a*c);
int x1 = ((-1*b) + Math.sqrt(d))/(2*a);
int x2 = ((-1*b) - Math.sqrt(d))/(2*a);
int[] ans = {x1, x2};
return ans;
}