I am having some trouble figuring out how to skip duplicate values in my array below. The first array arrvalid holds the number while arrcpt holds the number of times the number appears. Yet when i run the program it prints both values when i only want the value to be printed once. Is there any way to correct this?
cout<<"Numbers chosen most: ";
int skip =0;
for(x=0;x<countval;x++)
{
for(q=0;q<countval;q++)
{
if((arrvalid[x]==arrvalid[q])&&(arrcpt[x] == 2))
{
skip=q;
}
}
cout<<" "<<arrvalid[skip];
}
Output when q starts at 1: 93 93 34 34 34 34;