Count pairs with Bitwise XOR as ODD number | Function to count number of odd pairs ; find all pairs ; return number of odd pair ; Driver Code ; calling function findOddPair and print number of odd pair
< ? php function findOddPair ( $ A , $ N ) { $ count = 0 ; for ( $ i = 0 ; $ i < $ N ; $ i ++ ) { if ( $ A [ $ i ] % 2 == 0 ) $ count ++ ; } return $ count * ( $ N - $ count ) ; } $ a = array ( 5 , 4 , 7 , 2 , 1 ) ; $ n = count ( $ a ) ; echo ( findOddPair ( $ a , $ n ) ) ; ? >