The problem consists of solving a quadratic equation, for D> 0, A> 0.
But it is necessary:
First print the smaller and then the larger of the found roots. The roots of the quadratic equation are found by the formula ...
Is it possible to do it at all without using the conditions ?? JS language.
Start code:
var a = +prompt("Введите значение коэффициента А (A > 0)", ""); var b = +prompt("Введите значение коэффициента B", ""); var c = +prompt("Введите значение коэффициента C", ""); var discriminant = ( (b * b) - (4 * a * c) ); var x1 = ( -b + Math.sqrt(discriminant) ) / ( 2 * a ); var x2 = ( -b - Math.sqrt(discriminant) ) / ( 2 * a );
min(a,b)=(a+b+abs(ab))/2max(a,b)=a+b-min(a,b)- AkinaAis the senior coefficient, andDis the discriminant, and it is known thatA > 0andD > 0, then this is a task for the kindergarten. What is the difficulty then? - AnT