We look at the division of 767987 by 40 
We're looking to find how many times 40 goes into 767987.

Advancing to step 1:
The number 40 fits into 7 0 times, leaving a remainder of 7.
The next digit of our result is 0. 
Result so far: 0.0
Subtract 0 from 7 to get 7.
Append the next digit (6) from the dividend to 7 and continue with: 76 / 40

Let's proceed to step 2:
40 goes into 76 1 times with a remainder of 36.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
Deduct 40 from 76 and we're left with 36.
Append the next digit (7) from the dividend to 36 and continue with: 367 / 40

Advancing to step 3:
The number 40 fits into 367 9 times, leaving a remainder of 7.
Put 9 as the next digit of the answer. 
Result so far: 19.0
If we subtract 360 from 367, we get 7.
Append the next digit (9) from the dividend to 7 and continue with: 79 / 40

Let's proceed to step 4:
When dividing 79 by 40, we get 1 with a remainder of 39.
The number 1 becomes the next digit in our result. 
Result so far: 191.0
Deduct 40 from 79 and we're left with 39.
Take the next digit (8) from the dividend and append it to 39, then repeat: 398 / 40

Advancing to step 5:
When dividing 398 by 40, we get 9 with a remainder of 38.
Record the quotient 9 as the next digit in the result. 
Result so far: 1919.0
If we take 360 away from 398, we end up with 38.
Grab the next digit (7) from the dividend, add it to 38, then carry on: 387 / 40

Step 6:
40 can be fit into 387 9 times, resulting in a remainder of 27.
Record the quotient 9 as the next digit in the result. 
Result so far: 19199.0
If we take 360 away from 387, we end up with 27.
Since there are no more digits in the dividend, we add a zero to the remainder making it 270, and continue the process.

Going ahead to step 7:
40 goes into 270 6 times with a remainder of 30.
The next digit of our result is 6. 
Result so far: 19199.6
Subtract 240 from 270 to get 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Advancing to step 8:
40 goes into 300 7 times with a remainder of 20.
Write down 7 as next digit of the result. 
Result so far: 19199.67
If we take 280 away from 300, 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:
The number 40 fits into 200 5 times, leaving a remainder of 0.
Put 5 as the next digit of the answer. 
Result so far: 19199.675
Subtracting 200 from 200 leaves us 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.

Going ahead to step 10:
The number 40 fits into 0 0 times, leaving a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 19199.675
Subtract 0 from 0 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 11:
If we divide 0 by 40, we get 0 and a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 19199.675
Subtracting 0 from 0 leaves us 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.

The quotient of the division is 19199.675, and the remainder is 0.0.