There are 10 boxes,if 7 contain pens,3 contain pens and pencils,2 contain pencils only.how many empty boxes are there?

Make a Venn diagram of two intersectiong circles.

Label one PENS and the other PENCILS
put 3 in the intersection of both circles
leaving 4 to go into the remaining part of circle PENS
put 2 in the remaining part of PENCILS
adding those numbers:
4+3+2 give us 9 boxes with some kind of content
leaving 1 box to be empty.