The task is to read N digits within a range from 0 to 9 and find frequency of occurrence for entered digits. In addition to that, I need to find min and max values and also the most common number(s). Using at least 3 functions is required(storing input isn't allowed))

So far I completed finding occurrences and min and max value entered.
I have problems with finding the most common number(s) and creating functions. I have created separate variables for each number to find the frequency.
Also, this code doesn't seem to be very good and in case you have better solutions for this problem, please share.

```
{
    int n=0;
    int max=0,min=9;
    int freq0=0,freq1=0,freq2=0,freq3=0,freq4=0,freq5=0,freq6=0,freq7=0,freq8=0,freq9=0;

    for (;;)
    {
        printf ("Please enter the number in range from 0 to 9 (to break enter: 11): ");
        scanf ("%d",&n);
        if (n==11)//to exit the loop 11 is setteled as a stop value
            break;
        if (n==0)
            freq0++;
        if (n==1)
            freq1++;
        if (n==2)
            freq2++;
        if (n==3)
            freq3++;
        if (n==4)
            freq4++;
        if (n==5)
            freq5++;
        if (n==6)
            freq6++;
        if (n==7)
            freq7++;
        if (n==8)
            freq8++;
        if (n==9)
            freq9++;
        if (n>max)
            max=n;
        if (n<min)
            min=n;
    }

    printf ("Number 0 occured %d times\n",freq0);
    printf ("Number 1 occured %d times\n",freq1);
    printf ("Number 2 occured %d times\n",freq2);
    printf ("Number 3 occured %d times\n",freq3);
    printf ("Number 4 occured %d times\n",freq4);
    printf ("Number 5 occured %d times\n",freq5);
    printf ("Number 6 occured %d times\n",freq6);
    printf ("Number 7 occured %d times\n",freq7);
    printf ("Number 8 occured %d times\n",freq8);
    printf ("Number 9 occured %d times\n",freq9);
    printf ("highest %d \n", max);
    printf ("smallest %d\n",min);
    return 0;
}

```