Check whether bitwise AND of N numbers is Even or Odd | Java implementation of the approach ; Function to check if the bitwise AND of the array elements is even or odd ; If at least an even element is present then the bitwise AND of the array elements will be even ; Driver code
import java . io . * ; class GFG { static void checkEvenOdd ( int [ ] arr , int n ) { for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 == 0 ) { System . out . print ( " Even " ) ; return ; } } System . out . println ( " Odd " ) ; } public static void main ( String [ ] args ) { int [ ] arr = { 2 , 12 , 20 , 36 , 38 } ; int n = arr . length ; checkEvenOdd ( arr , n ) ; } }