The "mode" is the number which appears the most times in the input data. Hence, in the OP's example, the answer is 6, because it appears more times than any other number.
My solution would be to use a std::map. For each number that you read from the list, check if it already has an entry in the map. If it doesn't (i.e. it's the first instance of this number that you've read), then create the entry and initialise it to 1. If it already has an entry, then increment it.
Once you've finished reading all the numbers, then iterate over the map to find the entry with the highest value. That entry is the mode.
thank you
i not to know, because i begin learn introduction programming in university
but teacher give home work very hard
i would like
example.
enter number : x
enter number : x
enter number : x
enter number : x
enter number : x
enter number : maximum 20 number
Well, we're not going to write your homework for you. The whole point of the homework is for you to think about the problem, and work out some logic that would do what you want, and then write some code that would perform those logical steps. You'll learn better by doing that yourself, then by asking us to do it for you.