addition modulo formula for n numbers code example Example: modulo addition (A + B) mod C = (A mod C + B mod C) mod C