Check a number is odd or even without modulus operator | Returns true if n is even , else odd ; Driver code
< ? php function isEven ( $ n ) { $ isEven = true ; for ( $ i = 1 ; $ i <= $ n ; $ i ++ ) $ isEven = ! $ isEven ; return $ isEven ; } $ n = 101 ; $ is = isEven ( $ n ) ? " Even " : " Odd " ; echo " $ is " ? >