#include <stdio.h>

int main() {
    int arr[] = {3,5,1,2,6,2,8,1,2,2};
    int n = sizeof(arr) / sizeof(arr[0]);
    int counts[100] = {0};

    for (int i = 0; i < n; i++) {
        counts[arr[i]]++;
    }

    int max = 0;
    int num = -1;
    for (int i = 0; i < 100; i++) {
        if (counts[i] > max) {
            max = counts[i];
            num = i;
        }
    }

    printf("%d",num);
    return 0;
}

Embed on website

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