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.
Error running test cases
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.
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.