The correct option is C 2n−2
Each object can be put either in box B1 (say) or in box B2(say). So, there are two choices for each of the n objects. Therefore the number of choices for n distinct objects is
2×2×⋯n−times×2=2n
One of these choices corresponds to either the first or the second box being empty.
Thus, there are 2n−2 ways in which neither box is empty.