public static string IsEvenOrOdd(int n)
{
if (n % 2 == 0)
return "EVEN";
else
return "ODD";
}
How it works:
For any given number, we divide the number by two and check the reminder. If the remainder is 0, then it means that the number is Even otherwise Odd.