Error running test cases

I have got the result but I don’t understand why it is not accepting it is showing wrong in test case 2 and test case 3. First test case is passed.

@lakshay2311 Please save your code on ide.codingblocks.com and share its link.

I have also added the statement for printing it in increasing order.

@lakshay2311 Your logic is correct but printing format is wrong.
For sample test case expected output is:
Real and Distinct
4 7

Your Output:
Real and Distinct
4 and 7

Remove that and from between the numbers

oh, okay thank you! lemme check once.

still not accepting it.

Is now the sample output same as your actual output?

yeah, and now only test case 2 is wrong. 3rd ran successfully.

@lakshay2311 Consider the input:
1 -8 16

Your output:
Imaginary

Expected:
Real and Equal
4 4

Just change line 22 to else if(D==0)

but how is it possible other cases are running successfully.

For conditional statements you have to use ==. You were using = with else if which is wrong.

1 Like

Okay, got it now. Thank you for your help.