Let's divide 540851 by 40
We're looking to find how many times 40 goes into 540851.

On to step 1:
If we divide 5 by 40, we get 0 and a remainder of 5.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 5, we get 5.
Grab the next digit (4) from the dividend, add it to 5, then carry on: 54 / 40

Let's proceed to step 2:
54 divided by 40 is 1 with a remainder of 14.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
The remainder is 14 after subtracting 40 from 54.
Bring next digit (0) of the dividend behind the 14 and repeat the process: 140 / 40

Let's proceed to step 3:
40 goes into 140 3 times with a remainder of 20.
Put 3 as the next digit of the answer. 
Result so far: 13.0
If we subtract 120 from 140, we get 20.
Append the next digit (8) from the dividend to 20 and continue with: 208 / 40

Step 4:
40 can be fit into 208 5 times, resulting in a remainder of 8.
Write down 5 as next digit of the result. 
Result so far: 135.0
Subtracting 200 from 208 leaves us with 8.
Grab the next digit (5) from the dividend, add it to 8, then carry on: 85 / 40

Let's proceed to step 5:
The number 40 fits into 85 2 times, leaving a remainder of 5.
Record the quotient 2 as the next digit in the result. 
Result so far: 1352.0
If we subtract 80 from 85, we get 5.
Grab the next digit (1) from the dividend, add it to 5, then carry on: 51 / 40

Advancing to step 6:
51 divided by 40 is 1 with a remainder of 11.
Record the quotient 1 as the next digit in the result. 
Result so far: 13521.0
If we take 40 away from 51, we end up with 11.
Since there are no more digits in the dividend, we add a zero to the remainder making it 110, and continue the process.

Step 7:
If we divide 110 by 40, we get 2 and a remainder of 30.
The number 2 becomes the next digit in our result. 
Result so far: 13521.2
If we subtract 80 from 110, 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.

Going ahead to step 8:
The number 40 fits into 300 7 times, leaving a remainder of 20.
Write down 7 as next digit of the result. 
Result so far: 13521.27
Subtract 280 from 300 to get 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Moving on to step 9:
The number 40 fits into 200 5 times, leaving a remainder of 0.
The next digit of our result is 5. 
Result so far: 13521.275
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 10:
When dividing 0 by 40, we get 0 with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 13521.275
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.

Advancing to step 11:
If we divide 0 by 40, we get 0 and a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 13521.275
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.

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