Question: This must be done without using the modular operator. The function is to add each element of the array, 2+3+5 = 10, and then call
1 Remainder of Dividing by Three The easiest way to find the remainder of a given integer like 235 when dividing by three is to calculate the remainder of 2 +3+5 instead. Use this idea to implement a recursive function that calculates the remainder of any given non-negative integer when dividing by three. Your function must obey the following signature: int nMOD3 (int n, int size) where array n specifies the input integer by storing each digit in one cell and size determines how many digits the input integer has. For example, nMODS (2, 3, 5, 3) is a valid function call. The remainder of n when dividing by three has to be returned by the nMOD3 function as its output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
