Let's divide 789800 by 40
We want to divide 789800 by 40.

Going ahead to step 1:
When dividing 7 by 40, we get 0 with a remainder of 7.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Subtract 0 from 7 to get 7.
Take the next digit (8) from the dividend and append it to 7, then repeat: 78 / 40

On to step 2:
40 can be fit into 78 1 times, resulting in a remainder of 38.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
Deduct 40 from 78 and we're left with 38.
Take the next digit (9) from the dividend and append it to 38, then repeat: 389 / 40

Step 3:
40 goes into 389 9 times with a remainder of 29.
Use 9 as the next digit of our solution. 
Result so far: 19.0
The remainder is 29 after subtracting 360 from 389.
Grab the next digit (8) from the dividend, add it to 29, then carry on: 298 / 40

Advancing to step 4:
40 can be fit into 298 7 times, resulting in a remainder of 18.
Put 7 as the next digit of the answer. 
Result so far: 197.0
If we subtract 280 from 298, we get 18.
Grab the next digit (0) from the dividend, add it to 18, then carry on: 180 / 40

Step 5:
180 divided by 40 is 4 with a remainder of 20.
Write down 4 as next digit of the result. 
Result so far: 1974.0
If we subtract 160 from 180, we get 20.
Bring next digit (0) of the dividend behind the 20 and repeat the process: 200 / 40

Step 6:
40 can be fit into 200 5 times, resulting in a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 19745.0
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.

Advancing to step 7:
40 can be fit into 0 0 times, resulting in a remainder of 0.
The next digit of our result is 0. 
Result so far: 19745.0
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.

Advancing to step 8:
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: 19745.0
Deduct 0 from 0 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.

The final result is 19745.0 with a remainder of 0.0.