making negative number positive using a function modulo in c code example Example: c++ modulo make it give only positive numbers int mod(int a, int b) { return (a+b)%b; }