Largest number M less than N such that XOR of M and N is even | C # program for the above problem . ; Function to find the maximum possible value of M ; Edge case ; M = N - 2 is maximum possible value ; Driver code
using System ; class GFG { static int getM ( int n ) { if ( n == 1 ) return - 1 ; else return n - 2 ; } static void Main ( ) { int n = 10 ; Console . Write ( getM ( n ) ) ; } }