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 ; Driver code
using System ; public class GFG { static bool isEven ( int n ) { bool isEven = true ; for ( int i = 1 ; i <= n ; i ++ ) isEven = ! isEven ; return isEven ; } public static void Main ( ) { int n = 101 ; if ( isEven ( n ) ) Console . Write ( " Even " ) ; else Console . Write ( " Odd " ) ; } }