It seems that one way would be to use two loops and a separate
counter.
The first loop say (i) would iterate through the array first pointing at array[0], and the second loop say (j) would compare the second, third,fourth (and so on) elements with the first element. J would appear to always = i+1 at the start of its iteration. Then after the first iteration i would point to the array [1] element and j would point to array[2]. this element and all succeeding elements would be compared with array[1]. and so on. If the element being traversed by j was == the element pointed to by i then the i counter could be increased by one. After each iteration print out the number of duplicates and zero the counter.
hope this helps.