scanf("%d %d", &number, &digit); printf("Number of digit %d in %d: %d\n", digit, number, CountDigit(number, digit));
return0; }
intCountDigit( int number, int digit ){ int z, i= 0; if (number < 0) number = -number; if (number == 0 && digit == 0) i ++; elsedo{ z = number % 10; number=number/10; if (z==digit){ i ++; } } while(number!=0); return i; }