I’m getting wrong answer for one test case. Please help.
Quadratic equations test case error
System.out.println(((-1b + Math.sqrt(Math.pow(b,2)-4ac))/2a) + " " + ((-1b - Math.sqrt(Math.pow(b,2)-4ac))/2a));
You have to print the smaller root first.
Also you should use ‘float’ in this question instead of ‘int’ as square root and power are involved, so you may get inaccurate results. You can typecast to ‘int’ while printing.