This question already has an answer here:
There are two babies, the truth baby and the false baby. The truth baby will respond to any question with a true answer, and the false baby will respond to any question with a false answer. The babies share a language of either burping or farting. A burp or fart would mean yes and no, but you don't know which is which. You also do not know which is the truth baby and which the false baby.
You are to ask each baby a single yes-or-no question. Your goal is to discover whether or not the truth baby has hair. (You can't simply look at it to find out, you must only use knowledge that you gain from asking questions.)