Okay so I am getting an error for my code that is trying to count how many of each integer there are in the array. And so im not sure how to fix it. Im getting the error on the while loop at the bottom. Any help would be appreciated. Thanks.
if (ndx != array.length)
while (array[ndx] == array[ndx + 1])
ndx++;
ndxand make sure it's< array.length(not!=) before you increment. Nevertheless, this is very ugly code that would likely cause an instructor to deduct many points. Consider renaming your variables to clear names (like index instead of ndx) and using functions to show what you're trying to do. (like findMatches()) instead of that inner for loop.