Good day
I'm trying to write a counting digits code
the problem is that when i entred 123 I got 0011000000 !Code:int main() { int numdigit[10], c,i; c=getchar(); i=0; for(i=0;i<10;++i) numdigit[i]=0; while((c=getchar())!=EOF & c>='0' & c<='9') ++numdigit[c-'0']; printf("the digits are"); for(i=0;i<10;++i) printf("%d",numdigit[i]); }
any help would be highly appreciated!