Count pairs with Bitwise XOR as ODD number | C # program to count pairs with XOR giving a 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
using System ; class GFG { static int findOddPair ( int [ ] A , int N ) { int i , count = 0 ; for ( i = 0 ; i < N ; i ++ ) { if ( A [ i ] % 2 == 0 ) count ++ ; } return count * ( N - count ) ; } public static void Main ( ) { int [ ] a = { 5 , 4 , 7 , 2 , 1 } ; int n = a . Length ; Console . Write ( findOddPair ( a , n ) ) ; } }