roundUpToEven function

int roundUpToEven(
  1. int x
)

Rounds x up to the nearest even number.

Implementation

int roundUpToEven(int x) => x + (x % 2);