diff --git a/Bit-Manipulation/OddEven.js b/Bit-Manipulation/OddEven.js new file mode 100644 index 0000000000..31cac8d419 --- /dev/null +++ b/Bit-Manipulation/OddEven.js @@ -0,0 +1,12 @@ +/* + author:IndianBlitz + This script will find number is Odd or even + in binary representation of given number +*/ +// Check even if true then return 1 else return 0 which means number is odd; +function checkEvenOdd (num) { + 'use strict' + if ((num & 1) === 0) return 1 + else return 0 +} +export { checkEvenOdd }