Check whether bitwise AND of N numbers is Even or Odd | Function to check if the bitwise AND of the array elements is even or odd ; If at least an even element is present then the bitwise AND of the array elements will be even ; Driver code
function checkEvenOdd ( arr , n ) { for ( let i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 == 0 ) { document . write ( " " ) ; return ; } } document . write ( " " ) ; } let arr = [ 2 , 12 , 20 , 36 , 38 ] ; let n = arr . length ; checkEvenOdd ( arr , n ) ;