Count pairs with Bitwise AND as ODD number | C # program to count pairs with Odd AND ; Count total odd numbers in ; return count of even pair ; Driver Code ; calling function findOddPair and print number of odd pair
using System ; class GFG { public static int findOddPair ( int [ ] A , int N ) { int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( ( A [ i ] % 2 == 1 ) ) { count ++ ; } } return count * ( count - 1 ) / 2 ; } public static void Main ( string [ ] args ) { int [ ] a = new int [ ] { 5 , 1 , 3 , 2 } ; int n = a . Length ; Console . WriteLine ( findOddPair ( a , n ) ) ; } }