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