Count pairs with Bitwise OR as Even number | C # program to count pairs with even OR ; Count total even numbers in array . ; return count of even pair ; Driver Code
using System ; class GFG { static int findEvenPair ( int [ ] A , int N ) { int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) if ( ( ! ( ( A [ i ] & 1 ) > 0 ) ) ) count ++ ; return count * ( count - 1 ) / 2 ; } public static void Main ( String [ ] args ) { int [ ] A = { 5 , 6 , 2 , 8 } ; int N = A . Length ; Console . WriteLine ( findEvenPair ( A , N ) ) ; } }