We're dividing 977887 by 40 
We want to divide 977887 by 40.

Going ahead to step 1:
If we divide 9 by 40, we get 0 and a remainder of 9.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtracting 0 from 9 leaves us with 9.
Fetch the next digit (7) from the dividend, attach it to 9 and continue: 97 / 40

On to step 2:
97 divided by 40 is 2 with a remainder of 17.
The next digit of our result is 2. 
Result so far: 2.0
If we take 80 away from 97, we end up with 17.
Grab the next digit (7) from the dividend, add it to 17, then carry on: 177 / 40

Going ahead to step 3:
The number 40 fits into 177 4 times, leaving a remainder of 17.
The next digit of our result is 4. 
Result so far: 24.0
Subtracting 160 from 177 leaves us with 17.
Fetch the next digit (8) from the dividend, attach it to 17 and continue: 178 / 40

Let's proceed to step 4:
If we divide 178 by 40, we get 4 and a remainder of 18.
Use 4 as the next digit of our solution. 
Result so far: 244.0
Subtracting 160 from 178 leaves us with 18.
Fetch the next digit (8) from the dividend, attach it to 18 and continue: 188 / 40

Advancing to step 5:
40 can be fit into 188 4 times, resulting in a remainder of 28.
Record the quotient 4 as the next digit in the result. 
Result so far: 2444.0
If we take 160 away from 188, we end up with 28.
Include the next digit (7) from the dividend after 28, then repeat: 287 / 40

On to step 6:
40 can be fit into 287 7 times, resulting in a remainder of 7.
The number 7 becomes the next digit in our result. 
Result so far: 24447.0
The remainder is 7 after subtracting 280 from 287.
Since there are no more digits in the dividend, we add a zero to the remainder making it 70, and continue the process.

Going ahead to step 7:
70 divided by 40 is 1 with a remainder of 30.
The number 1 becomes the next digit in our result. 
Result so far: 24447.1
If we subtract 40 from 70, we 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.

Let's proceed to step 8:
300 divided by 40 is 7 with a remainder of 20.
Put 7 as the next digit of the answer. 
Result so far: 24447.17
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.

Going ahead to step 9:
When dividing 200 by 40, we get 5 with a remainder of 0.
Put 5 as the next digit of the answer. 
Result so far: 24447.175
Deduct 200 from 200 and we're left 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.

Let's proceed to step 10:
40 goes into 0 0 times with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 24447.175
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.

Step 11:
0 divided by 40 is 0 with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 24447.175
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.

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