Let's divide 78542 by 40
Let's see how many times 40 fits into 78542.

Going ahead to step 1:
The number 40 fits into 7 0 times, leaving a remainder of 7.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Deduct 0 from 7 and we're left with 7.
Fetch the next digit (8) from the dividend, attach it to 7 and continue: 78 / 40

On to step 2:
78 divided by 40 is 1 with a remainder of 38.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
If we take 40 away from 78, we end up with 38.
Include the next digit (5) from the dividend after 38, then repeat: 385 / 40

On to step 3:
40 can be fit into 385 9 times, resulting in a remainder of 25.
Record the quotient 9 as the next digit in the result. 
Result so far: 19.0
The remainder is 25 after subtracting 360 from 385.
Append the next digit (4) from the dividend to 25 and continue with: 254 / 40

Advancing to step 4:
40 goes into 254 6 times with a remainder of 14.
Use 6 as the next digit of our solution. 
Result so far: 196.0
If we subtract 240 from 254, we get 14.
Append the next digit (2) from the dividend to 14 and continue with: 142 / 40

Advancing to step 5:
The number 40 fits into 142 3 times, leaving a remainder of 22.
Record the quotient 3 as the next digit in the result. 
Result so far: 1963.0
The remainder is 22 after subtracting 120 from 142.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

Advancing to step 6:
The number 40 fits into 220 5 times, leaving a remainder of 20.
Write down 5 as next digit of the result. 
Result so far: 1963.5
Subtracting 200 from 220 leaves us 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.

Advancing to step 7:
200 divided by 40 is 5 with a remainder of 0.
The next digit of our result is 5. 
Result so far: 1963.55
If we take 200 away from 200, 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 1963.55, and the remainder is 0.0.