First off, you don't need to check if it is different twice:
Is the same as:
Second, the values you are expecting are wrong: it's not 1, 3, 4 you should get, but 3, 4, 5 - those are the ones you need to move...
Third, you need to return the new length, or the outside world can't tell how many unique elements there were - and so how much data the outside world should process now.
Fourth, you need to check your values - your while loop will run off the end of the array! :laugh:
Fifth, it's also a good idea to use longer, more meaningful names - it helps to self dcoument the code when you read it.
Sixth, get your indentation right, and be consistent in your curly bracket positioning!
Having the style change makes it much, much harder to read...
So, try this:
int remove_dup(int count ,int arr)
return out + 1;
int newLen = remove_dup(7,data);
for (index = 0; index < newLen; index++)
printf("\nPress ENTER to close. ");
closing bold in wrong place :O - OriginalGriff[/edit]