I\'m working on a small program that counts the number of times an integer appears in an array. I managed to do this but there is one thing I can\'t overcome.
My cod
very simple logic to count how many time a digit apper
#include
int main()
{
int a,b,c,k[10];
int p[10]={0};
int bb[10]={0};
scanf("%d\n",&a);
for(b=0;b0;b--)
{
for(c=b-1;c>=0;c--)
{
if((k[b]==k[c])&&(bb[c]==0))
{
p[b]=p[b]+1;
bb[c]=1;
}
}
}
for(c=0;c