I hope the following example will make it a little more clear of how to use the modulo-operator in this situation.

Using scanf() you have retrieved an integer N, which you want to store in an array A. Then you could use the following algorithm:

Code:

// Determine the first digit
M = N % 10
// Store the first digit
A [0] = M
// Prepare N for the next iteration
N = (N - M) / 10
// Note: if N is now 0, this means that N is equal to M. And since
// M is a single digit, this means N is also a single digit, so then we
// have finished the number.
// Now repeat this process until you have finished the number

Example with N = 123.

Calculate -> 123 % 10 = 3

Store -> A [0] = 3

Calculate -> (123 - 3) / 10 = 12

Calculate -> 12 % 10 = 2

Store -> A [1] = 2

Calculate -> (12 - 2) / 10 = 1

Calculate -> 1 % 10 = 1

Store -> A [2] = 1

Calculate -> (1 - 1) / 10 = 0

Now we are finished.