When people ask me how I come to be interested in this, that, or the other obscure subject, I've come to reply over the years that I'm fascinated by complicated domains of knowledge. Not for me the path of broad generalizing simplicity; I like the quirky, the peculiar, the inexplicable. So I will now treat those of you who think similarly to the question of how to say "Yes" and "No" in various languages.
First of all, plenty of languages don't have any such words. Irish is a good example: it just repeats the verb, with or without a negation. This is why people from Ireland, even if their ancestors have been speaking only English for generations, tend to affirm with "I do" or "He was" (and other combinations of pronoun and auxiliary verb), and deny with "I do not" or "He was not". But just looking at a few languages that do have such words, we see a variety of patterns.
The interesting cases arise when the question being answered is a negative one, like "Didn't he go to the store?". Let's just look at the raw data first (where Y = "Did he go?"; N = "Didn't he go?"; y = "He did"; n = "He didn't):
English: Yy=Yes, Yn=No, NyYes, Ny=No
French: Yy=Oui, Yn=Non, Ny=Si, Nn=Non
German: Yy=Ja, Yn=Nein, Ny=Doch, Nn=Nein
Russian: Yy=Da, Yn=Nyet, Ny=Nyet, Nn=Da
Japanese: Yy=Hai, Yn=Iie, Ny=Iie, Nn=Hai
Lojban: Yy=go'i, Yn=na go'i, Ny=ja'a go'i, Nn=na go'i
So we can see that English totally ignores any negation in the question as far as determining whether to say "Yes" or "No". That doesn't mean the negation is meaningless: in fact, it indicates the response the asker is expecting. Latin, which is a verb-repeating language like Irish, actually has three different ways to make yes-no questions: with the clitic -ne attached to the verb, there is no particular expectation; with the particle nonne, an affirmative answer is expected; with the particle num, a negative answer is expected.
Russian and Japanese take the view that a negation in the question is just like any other negation: it has to be taken into account. So with a negative question, nyet or iie means "On the contrary, he did", and da or hai means "That's correct, he didn't." This view is quite logical, though it seems bizarre to English-speakers. (Disclaimer: Japanese culture has qualms about both plain questions and plain answers, and so this explication really only applies to usage between intimate friends.)
German and French agree with English in using their word for "No" to give a negative answer to a negative question, but they use a separate word for affirmative, contrary-to-expectation answers to negative questions. In German, doch can be stuck into an ordinary sentence to indicate that what it expresses is contrary to expectation; German has a lot of particles like this.
Finally, in Lojban the word go'i means in effect "What you said"; it repeats the speaker's last remark. However, if the explicit negation word na is present, it supplies negation whether or not it is already present. Likewise, the explicit affirmation word ja'a supplies affirmation whether or not it's already present. So it would be correct, if redundant, to use ja'a go'i in the first line and na go'i in the last line.
Isn't all this just neat??