I am writing a program in which user enter any value and the program calculates the occurence of any digit in a number. For example, if user enter 4323122 the output should like this
3 is present 2 times in a number.
2 is present 3 times in a number.
The code I have written is here but there is a mistake which i am unable to resolve.
int num, m, div=1, rem, count=0, i,n, a;
printf("Enter Number: ");
for(i=1; i<=10; i++)
if(i==rem && count>=2)
printf("\n%d is present %d times", i, count);