Check a number is odd or even without modulus operator | A simple C # program to check for even or odd ; Returns true if n is even , else odd ; Return true if n / 2 does not result in a float value . ; Driver code
using System ; class GFG { static bool isEven ( int n ) { return ( ( n / 2 ) * 2 == n ) ; } public static void Main ( String [ ] args ) { int n = 101 ; if ( isEven ( n ) != false ) Console . Write ( " Even " ) ; else Console . Write ( " Odd " ) ; } }