We look at the division of 876865 by 40 
Let's see how many times 40 fits into 876865.

Moving on to step 1:
8 divided by 40 is 0 with a remainder of 8.
The next digit of our result is 0. 
Result so far: 0.0
Deduct 0 from 8 and we're left with 8.
Include the next digit (7) from the dividend after 8, then repeat: 87 / 40

Step 2:
40 can be fit into 87 2 times, resulting in a remainder of 7.
The next digit of our result is 2. 
Result so far: 2.0
The remainder is 7 after subtracting 80 from 87.
Include the next digit (6) from the dividend after 7, then repeat: 76 / 40

Let's proceed to step 3:
40 goes into 76 1 times with a remainder of 36.
Write down 1 as next digit of the result. 
Result so far: 21.0
Subtract 40 from 76 to get 36.
Append the next digit (8) from the dividend to 36 and continue with: 368 / 40

Step 4:
40 goes into 368 9 times with a remainder of 8.
The next digit of our result is 9. 
Result so far: 219.0
Deduct 360 from 368 and we're left with 8.
Fetch the next digit (6) from the dividend, attach it to 8 and continue: 86 / 40

On to step 5:
The number 40 fits into 86 2 times, leaving a remainder of 6.
Put 2 as the next digit of the answer. 
Result so far: 2192.0
Deduct 80 from 86 and we're left with 6.
Include the next digit (5) from the dividend after 6, then repeat: 65 / 40

Let's proceed to step 6:
The number 40 fits into 65 1 times, leaving a remainder of 25.
Put 1 as the next digit of the answer. 
Result so far: 21921.0
Subtract 40 from 65 to get 25.
Since there are no more digits in the dividend, we add a zero to the remainder making it 250, and continue the process.

Moving on to step 7:
The number 40 fits into 250 6 times, leaving a remainder of 10.
Record the quotient 6 as the next digit in the result. 
Result so far: 21921.6
Deduct 240 from 250 and we're left with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Step 8:
40 goes into 100 2 times with a remainder of 20.
Write down 2 as next digit of the result. 
Result so far: 21921.62
If we take 80 away from 100, we end up with 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

On to step 9:
200 divided by 40 is 5 with a remainder of 0.
The next digit of our result is 5. 
Result so far: 21921.625
Subtract 200 from 200 to get 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Going ahead to step 10:
0 divided by 40 is 0 with a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 21921.625
If we take 0 away from 0, we end up with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Moving on to step 11:
40 goes into 0 0 times with a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 21921.625
The remainder is 0 after subtracting 0 from 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

After the division, we end up with 21921.625 and a remainder of 0.0.