Skip to content

Commit 513d12d

Browse files
Merge pull request matthewsamuel95#553 from shakib609/master
Add evenOdd(BitManipulation) implementation in javascript and python
2 parents d504388 + 5708273 commit 513d12d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

BitManipulation/even_odd/evenOdd.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const x = 12;
2+
3+
if (x & 1)
4+
console.log(x + " is an odd number");
5+
else
6+
console.log(x + " is an even number");

BitManipulation/even_odd/evenOdd.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
x = int(input("Enter an integer: "))
2+
3+
if x & 1:
4+
print("%d is an odd number" % x)
5+
else:
6+
print("%d is an even number" % x)

0 commit comments

Comments
 (0)