Parity of the given mathematical expression using given N numbers | Java program to determine the parity of the given mathematical expression ; Iterating through the given integers ; If any odd number is present , then S is even parity ; Else , S is odd parity ; Driver code
class GFG { static void getParity ( int n , int [ ] A ) { for ( int x : A ) { if ( ( x & 1 ) == 1 ) { System . out . println ( " Even " ) ; return ; } } System . out . println ( " Odd " ) ; } public static void main ( String [ ] args ) { int N = 3 ; int [ ] A = { 2 , 3 , 1 } ; getParity ( N , A ) ; } }