Let's divide 788997 by 40
We want to figure out the number of times 788997 can be divided by 40.

On to step 1:
When dividing 7 by 40, we get 0 with a remainder of 7.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we take 0 away from 7, we end up with 7.
Bring next digit (8) of the dividend behind the 7 and repeat the process: 78 / 40

On to step 2:
If we divide 78 by 40, we get 1 and a remainder of 38.
Write down 1 as next digit of the result. 
Result so far: 1.0
If we take 40 away from 78, we end up with 38.
Append the next digit (8) from the dividend to 38 and continue with: 388 / 40

Moving on to step 3:
If we divide 388 by 40, we get 9 and a remainder of 28.
Record the quotient 9 as the next digit in the result. 
Result so far: 19.0
If we subtract 360 from 388, we get 28.
Take the next digit (9) from the dividend and append it to 28, then repeat: 289 / 40

Moving on to step 4:
When dividing 289 by 40, we get 7 with a remainder of 9.
Put 7 as the next digit of the answer. 
Result so far: 197.0
The remainder is 9 after subtracting 280 from 289.
Include the next digit (9) from the dividend after 9, then repeat: 99 / 40

Step 5:
The number 40 fits into 99 2 times, leaving a remainder of 19.
Record the quotient 2 as the next digit in the result. 
Result so far: 1972.0
The remainder is 19 after subtracting 80 from 99.
Take the next digit (7) from the dividend and append it to 19, then repeat: 197 / 40

Advancing to step 6:
If we divide 197 by 40, we get 4 and a remainder of 37.
Record the quotient 4 as the next digit in the result. 
Result so far: 19724.0
If we subtract 160 from 197, we get 37.
Since there are no more digits in the dividend, we add a zero to the remainder making it 370, and continue the process.

Advancing to step 7:
40 can be fit into 370 9 times, resulting in a remainder of 10.
The next digit of our result is 9. 
Result so far: 19724.9
If we subtract 360 from 370, we get 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Going ahead to step 8:
The number 40 fits into 100 2 times, leaving a remainder of 20.
The next digit of our result is 2. 
Result so far: 19724.92
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.

Going ahead to step 9:
The number 40 fits into 200 5 times, leaving a remainder of 0.
Write down 5 as next digit of the result. 
Result so far: 19724.925
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:
If we divide 0 by 40, we get 0 and a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 19724.925
If we subtract 0 from 0, we 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:
0 divided by 40 is 0 with a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 19724.925
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.

The final outcome is 19724.925, with a leftover of 0.0.