IsOdd

        public static bool IsOdd(this int value)
        {
            return value % 2 != 0;
        }
Example:
int number = 1;
bool isOdd = number.IsOdd(); // true

int number = 2;
bool isOdd = number.IsOdd(); // false

Description

Checks whether a number is odd

Details

Double click on the code to select all.

 

;