Let's divide 506042 by 40
Our goal is to divide 506042 by 40.

On to step 1:
If we divide 5 by 40, we get 0 and a remainder of 5.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
If we subtract 0 from 5, we get 5.
Include the next digit (0) from the dividend after 5, then repeat: 50 / 40

Step 2:
If we divide 50 by 40, we get 1 and a remainder of 10.
Put 1 as the next digit of the answer. 
Result so far: 1.0
If we take 40 away from 50, we end up with 10.
Fetch the next digit (6) from the dividend, attach it to 10 and continue: 106 / 40

Advancing to step 3:
The number 40 fits into 106 2 times, leaving a remainder of 26.
Write down 2 as next digit of the result. 
Result so far: 12.0
If we take 80 away from 106, we end up with 26.
Fetch the next digit (0) from the dividend, attach it to 26 and continue: 260 / 40

Going ahead to step 4:
When dividing 260 by 40, we get 6 with a remainder of 20.
Record the quotient 6 as the next digit in the result. 
Result so far: 126.0
Subtract 240 from 260 to get 20.
Take the next digit (4) from the dividend and append it to 20, then repeat: 204 / 40

Step 5:
When dividing 204 by 40, we get 5 with a remainder of 4.
Record the quotient 5 as the next digit in the result. 
Result so far: 1265.0
The remainder is 4 after subtracting 200 from 204.
Take the next digit (2) from the dividend and append it to 4, then repeat: 42 / 40

Let's proceed to step 6:
If we divide 42 by 40, we get 1 and a remainder of 2.
Put 1 as the next digit of the answer. 
Result so far: 12651.0
Subtracting 40 from 42 leaves us with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Step 7:
If we divide 20 by 40, we get 0 and a remainder of 20.
Use 0 as the next digit of our solution. 
Result so far: 12651.0
The remainder is 20 after subtracting 0 from 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Let's proceed to step 8:
When dividing 200 by 40, we get 5 with a remainder of 0.
Write down 5 as next digit of the result. 
Result so far: 12651.05
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.

Step 9:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 12651.05
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.

On to step 10:
0 divided by 40 is 0 with a remainder of 0.
The next digit of our result is 0. 
Result so far: 12651.05
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 quotient of the division is 12651.05, and the remainder is 0.0.