Method IncrementIfOdd
IncrementIfOdd(int)
Increments the given number by 1 if it is odd; otherwise, returns the number unchanged.
public static int IncrementIfOdd(int number)
Parameters
number
intThe integer to check and possibly increment.
Returns
- int
The incremented number if it is odd; otherwise, the original number.