I think that you mean 10% are taking both Physics and Chemistry (that's 4)
16 are taking Physics. So, 16-4 = 12 are taking Physics, but not Chemistry.
12 are taking Chemistry. So, 12-4 = 8 are taking Chemistry, but not Physics
So, 12 + 8 + 4 = 24 are taking one or both classes.
That leaves 40 - 24 = 16 that are taking neither class.
You could also solve this problem using a Venn Diagram, if you are familiar with that concept.