Number of pairs with Bitwise OR as Odd number | Function to count pairs with odd OR ; find OR operation check odd or odd ; return count of odd pair ; Driver Code
function findOddPair ( A , N ) { let oddPair = 0 ; for ( let i = 0 ; i < N ; i ++ ) { for ( let j = i + 1 ; j < N ; j ++ ) { if ( ( A [ i ] A [ j ] ) % 2 != 0 ) oddPair ++ ; } } return oddPair ; } let A = [ 5 , 6 , 2 , 8 ] ; let N = A . length ; document . write ( findOddPair ( A , N ) ) ;