#include <stdio.h>

int main() {
    int arr[10] = {3,5,1,2,6,2,8,1,2,2};
    int b[10] = {};

    for (int i = 1;i <= 9;i++) {
        b[arr[i]] += 1;
    }

    int max = b[0];
    int idx = 0;
    
    for (int i = 1;i <= 9;i++) {
        if (max < b[i]) {
            max = b[i];
            idx = i;
        }        
    }

    printf("%d ",max);
    printf("%d ",idx);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: