human
Can you provide a code to count pairs with Bitwise XOR as EVEN number and the other steps required given the following:
Count pairs with Bitwise XOR as EVEN number | Function to count number of even pairs.
find all pairs.
return number of even pair.
Driver Code.
calling function findEvenPair and pr number of even pair"
Solution in Python:
assistant
#Here is code to count pairs with Bitwise XOR as EVEN number and the other steps required.
 def findEvenPair ( A , N ) :
	count = 0
	for i in range ( 0 , N ) :
		if ( A [ i ] % 2 != 0 ) :
			count += 1
	totalPairs = ( N * ( N - 1 ) / 2 )
	oddEvenPairs = count * ( N - count )
	return ( int ) ( totalPairs - oddEvenPairs )
def main ( ) :
	a = [ 5 , 4 , 7 , 2 , 1 ]
	n = len ( a )
	print ( findEvenPair ( a , n ) )
if __name__ == ' _ _ main _ _ ' :
	main ( )