>>check each element and if it spots another one just like it, to do an incrementation.
You mean check for duplicates? And what do you mean by "do an incrementation"? You mean if another element is the same as the one you're checking, make the other element 1 bigger?
**EDIT**
Judging from your function name, you're trying to find the element that has the biggest number of repetitions? Personally I would use a std::map to do it, but I assume you're not into that yet. You can create another array, which is used to store the counts of each element, and then print the element with the highest count:
Code:
int array1[10] = {1,2,2,3,4,5,5,5,6,1};
int counts[10] = {0,0,0,0,0,0,0,0,0,0};
//Count the repetitions of each element
for(int i = 0; i < 10; ++i)
{
for(int j = 0; j < 10; ++j)
{
if(array1[j] == array1[i])
++counts[i];
}
}
//Find the element with the highest count
int highestIndex = 0;
for(i = 1; i < 10; ++i)
{
if(counts[i] > counts[highestIndex])
highestIndex = i;
}
cout << array1[highestIndex]; //print out the number with the most repetitions