diff options
Diffstat (limited to 'progs/a746.py')
-rw-r--r-- | progs/a746.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/progs/a746.py b/progs/a746.py new file mode 100644 index 0000000..938c495 --- /dev/null +++ b/progs/a746.py @@ -0,0 +1,8 @@ +def even_bit_toggle_number(n) :
+ res = 0; count = 0; temp = n
+ while(temp > 0 ) :
+ if (count % 2 == 0) :
+ res = res | (1 << count)
+ count = count + 1
+ temp >>= 1
+ return n ^ res
\ No newline at end of file |