From bb714275dc02e1e88156cd1cff8bfd93308267ea Mon Sep 17 00:00:00 2001 From: IndianBlitz <101599761+IndianBlitz@users.noreply.github.com> Date: Fri, 1 Jul 2022 19:25:02 +0530 Subject: [PATCH 1/4] add newfile OddEven to bits --- Bit-Manipulation/OddEven.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Bit-Manipulation/OddEven.js diff --git a/Bit-Manipulation/OddEven.js b/Bit-Manipulation/OddEven.js new file mode 100644 index 0000000000..6e6fa5a3d1 --- /dev/null +++ b/Bit-Manipulation/OddEven.js @@ -0,0 +1,22 @@ + + + +/* + author: vivek9patel + + + 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} \ No newline at end of file From a4588bf237f19a9e8351086033bb40169a71d516 Mon Sep 17 00:00:00 2001 From: IndianBlitz <101599761+IndianBlitz@users.noreply.github.com> Date: Fri, 1 Jul 2022 19:44:04 +0530 Subject: [PATCH 2/4] Update OddEven.js --- Bit-Manipulation/OddEven.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bit-Manipulation/OddEven.js b/Bit-Manipulation/OddEven.js index 6e6fa5a3d1..7eb1edc104 100644 --- a/Bit-Manipulation/OddEven.js +++ b/Bit-Manipulation/OddEven.js @@ -2,7 +2,7 @@ /* - author: vivek9patel + author: IndianBlitz This script will find number is Odd or even @@ -19,4 +19,4 @@ function checkEvenOdd(num){ return 0; } -export {CheckEvenOdd} \ No newline at end of file +export {checkEvenOdd} From 5234f12f58d9e1017a0ef23d9ff385d6e23beaa6 Mon Sep 17 00:00:00 2001 From: IndianBlitz <101599761+IndianBlitz@users.noreply.github.com> Date: Fri, 1 Jul 2022 19:45:30 +0530 Subject: [PATCH 3/4] Update OddEven.js --- Bit-Manipulation/OddEven.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Bit-Manipulation/OddEven.js b/Bit-Manipulation/OddEven.js index 7eb1edc104..37c9099a7e 100644 --- a/Bit-Manipulation/OddEven.js +++ b/Bit-Manipulation/OddEven.js @@ -4,11 +4,8 @@ /* 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){ From 26b0bc5e2c11608ffacd8961bfdeb22fa73eca9e Mon Sep 17 00:00:00 2001 From: IndianBlitz <101599761+IndianBlitz@users.noreply.github.com> Date: Fri, 1 Jul 2022 19:51:14 +0530 Subject: [PATCH 4/4] Update OddEven.js --- Bit-Manipulation/OddEven.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Bit-Manipulation/OddEven.js b/Bit-Manipulation/OddEven.js index 37c9099a7e..9bbdb7f418 100644 --- a/Bit-Manipulation/OddEven.js +++ b/Bit-Manipulation/OddEven.js @@ -1,19 +1,18 @@ - - - /* author: IndianBlitz - + This script will find number is Odd or even - */ -//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 + if((num & 1) === 0){ + return 1; + } + else{ return 0; + } + } -export {checkEvenOdd} +export { checkEvenOdd };