These riddles are a play on words. You say one thing and it's interpreted by the listener as something completely different. You can comment and say that these riddles are stupid and that this is a dumb blog, but I can guarantee that these will confound anyone you tell these to.
1. There were 40 dogs and 30 ate cats. How many didn't?
(It sounds like you said that there were 40 dogs and 38 cats; so when you ask: how many didn't, the listener is completely confused.)
2. There were 30 people in a swimming pool. All 30 people went underwater and when they came back up, there were 30 foreheads. How is that possible?
(It sounds like you said that when they came back up, there were 34 heads)
These riddles sound so terrible on paper, but so confusing when said out loud. I haven't met someone who actually got these riddles correct. Try them on your friends and family. Find out how smart they really are.