Check whether product of ' n ' numbers is even or odd | function to check whether product of ' n ' numbers is even or odd ; if a single even number is found , then final product will be an even number ; product is an odd number ; Driver code
< ? php function isProductEven ( $ arr , $ n ) { for ( $ i = 0 ; $ i < $ n ; $ i ++ ) if ( ( $ arr [ $ i ] & 1 ) == 0 ) return true ; return false ; } $ arr = array ( 2 , 4 , 3 , 5 ) ; $ n = sizeof ( $ arr ) ; if ( isProductEven ( $ arr , $ n ) ) echo " Even " ; else echo " Odd " ; ? >