Java Operators(Arithmetic) | Set 1
Submissions: 5069   Accuracy:

17.01%

  Difficulty: Basic   Marks: 1

Given three numbers A,B and C. Find roots of quadratic equation Ax2 + Bx + C = 0. (A not equal to  0)

Input:
First line of the input contains an integer T which denotes the number of test cases. Then T test cases follow.  Each test case contains a single line containing three space separated integers A,B and C. 

Output: 
For each test case, Print two roots of quadratic equation(space separated) in ascending order. For complex roots,print COMPLEX.

Constraints:
1 <= T< = 100
-10<=A<=10
-10<=B<= 10
-10<=C<= 10

Note: A is not equal to 0.

Example:
Input:

3
2 3 4
3 5 1
1 -4 4    
Output:
COMPLEX
-1.4342586 -0.23240812 
2.0 2.0

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Gaurav Miglani
Author: gaurav miglani


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.