The total number of apples delivered was 42 × 12 = <<42*12=504>>504.

There are 504 - 4 = <<504-4=500>>500 apples were left remaining.

Finally, there are 500 ÷ 10 = <<500/10=50>>50 boxes of apples.

# Answer

50
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
There are 42 apples in a crate. 12 crates of apples were delivered to a factory. 4 apples were rotten and had to be thrown away. The remaining apples were packed into boxes that could fit 10 apples each. How many boxes of apples were there?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
50
There are 42 apples in a crate. 12 crates of apples were delivered to a factory. 4 apples were rotten and had to be thrown away. The remaining apples were packed into boxes that could fit 10 apples each. How many boxes of apples were there?
train