Why my code is not working

I don’t think this is the correct code for this problem

https://ide.codingblocks.com/s/289627

i think i have posted a wrong link by mistake i have created a new link please check it

@Akshita99 the problem is arising because of this line
image
its because precedence issues
its being calculated as (!x) & 1
whereas you want !(x&1)
i hope you got the reason!
you can skip the if condition if you want (its either 1 or 0, you need to check only once)
if you want to use this condition then use it with brackets

One more thing, print answer of each test case in a new line.
Dont fotget to mark the doubt as resolved :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.