What's wrong with this code?
You must be signed in to leave a comment
26 April 2019, 15:44
Share your code like this: .
1 May 2019, 13:28
I cannot attach the code. I have solved the question so this option is showing me cross. But my confusion is not clear. With a little bit of modification to my code, it gets passed. If you have free time try to figure it out plz I am attaching some screenshots.
1 May 2019, 13:37
it should be num1 = abs(a - 10); num2 = abs(b - 10); checking if a and b are less than or equal to 0 is a redundant step.
1 May 2019, 14:10
Though I do not know why the code failed before you added the extra abs like this: abs(abs(a) + 10). I have tested it and it makes no difference to the outcome. Must just be a quirk in the validation system.
1 May 2019, 14:21
Yeah man! it is a redundant step. Thanx
1 May 2019, 14:23
But for the failing query maybe its a system fault.