how to take mod of negative number in c++ code example Example: c++ modulo make it give only positive numbers Click to copyint mod(int a, int b) { return (a+b)%b; }