CP Course: Bitmask Challenge : Not So Easy Math

I have pasted my code here :https://ide.codingblocks.com/s/202284

Can you please let me know why it’s giving wrong ans

I have made corrections in your code.