I need to round of a number (the input is guaranteed to be an integer & is positive) to the next multiple of 5.
I tried this:
int round = ((grade
This is my solution using cmath::abs
cmath::abs
int rounded = n + abs((n % denom) - denom);
You can change the denom with any other denomination you want
denom