nextMultipleOfN function

int nextMultipleOfN(
  1. int input,
  2. int n
)

Rounds input up to the nearest nth.

Implementation

int nextMultipleOfN(int input, int n) =>
    (input % n != 0) ? (input ~/ n + 1) * n : input;