Checking answer to a question in array

In an array of elements, say 20, every fifth element is a question, and one of the elements is the answer to that question. It’s like a quiz. How can I check if the user has selected the right answer? Any help would be appreciated.

It’s a totally different one.
Let me clarify. The questions are on the indices 4, 8, 12 & so on. The answer to the first question is between indices 0 & 8, and the answer to the second question is between indices 9 & 17, and so on. It means out of first 9 elements one is question whose index is fixed; and other elements are options out of which one is answer whose index is not fixed.

Please let me know if I am not clear or if you want further explanation.

Thanks a lot again. I have got the point. I am obliged.