My previous questions were about calulating how many times the first and second number in a sequence of numbers occurs. You told me to read number 2 times if I wanted to know how many times the second number occurs. What do I do if I wanted to know how many times for example the 10th number in the sequence occurs. What is the easy way instead of reading number ten times which is a rather long winded approach.
That's the only way to go. Remember that you can use a for loop to reach the 10th number, or you can first read numbers in an array, and then process it. This way, even if the 10th number also occures in the second position, it will be considered, by comparing all numbers against the 10th number.