Count pairs with Bitwise OR as Even number | Javascript program to count pairs with even OR ; Count total even numbers in array . ; return count of even pair ; Driver Code
function findEvenPair ( A , N ) { let count = 0 ; for ( let i = 0 ; i < N ; i ++ ) if ( ( ! ( ( A [ i ] & 1 ) > 0 ) ) ) count ++ ; return count * ( count - 1 ) / 2 ; } let A = [ 5 , 6 , 2 , 8 ] ; let N = A . length ; document . write ( findEvenPair ( A , N ) ) ;