I saw the property of mod where
(A*B)%m = (A%m * B%m) %m
And this property is used in the below algorithm to find the mod of very large numbers.
1.Get one variable to store the answer initialized to zero.
2.Scan the string from left to right,
3.every time multiply the answer by 10 and add the next number and take the modulo and store this as the new answer.
But I'm unable to understand this algorithm . How the property is connected to the algorithm here?
It will be helpful if used an example to understand the underneath math behind the algorithm , for example 12345%11