Jj Roberts wrote:Ah, I see. The problem is that you are only counting every time you find two of the same numbers, you are not counting how many there are of that number. Unfortunately I don't think the approach you are using at the moment will give you what you want. I suggest you start by counting how many there are of each number. Could you write some code to do that?
Jj Roberts wrote:You are trying to find the duplicate numbers in the array. 0, 4, and 12 are repeated in the array. You are getting output for the right numbers. What is missing? What do you want it to do?
Jj Roberts wrote:Hello, welcome to Coderanch!
It seems some of your code is missing; the loops don't have closing brackets. What in particular can we help you with? Do you get errors when you try to compile your code?