#include void ft_print_comb(void); int dcount[10] = {0}; // 10 ints, all initialized to 0 while(num) { dcount[num % 10]++; // increment dcount[i], where i is the last digit of num num /= 10; // "remove" last digit from num } for (int i = 0; i < sizeof(dcount)/sizeof(dcount[0]); i++) printf("%d occured %d times\n", i, dcount[i]);