Sir , ans = ans ^ no ; gives zero ?? as 0 ^ any number is zero.
hello @piyushkumar999999
no this is not correct. for example-> 0 ^ 1 is 1