still failing when a sequential of 2 repeated numbers is in array.
look: ...28,28....
Code:
#include <stdio.h>
int main()
{
int rptds[] = { 31,17,22,25,28,13,20,20,25,28,28,32 };
int a,b,c,d,e;
a=b=c=d=e=0;
a = sizeof(rptds)/sizeof(int)-1;
printf("0 -> %d\n",a);
for (b=0;b<=a; b++) printf("%d|",rptds[b]);
for (b=0; b<=a; b++)
{
for (c=b+1; c<=a; c++)
{
if (rptds[b]==rptds[c])
{
for (d=c; d<a; d++)
rptds[d]=rptds[d+1];
a--;
}
}
}
puts("\n--------------------\n");
printf("0 -> %d\n",a);
for (b=0;b<=a; b++) printf("%d|",rptds[b]);
return(0);
}
just compile it. you will see easily.