#include #include int main(int argc, char *argv[]) { // If no arguments (only program name) if (argc == 1) { printf("There are no arguments\n"); return 0; } int max_count = 0; char *most_common = NULL; // Compare each argument with others for (int i = 1; i < argc; i++) { int count = 0; for (int j = 1; j < argc; j++) { if (strcmp(argv[i], argv[j]) == 0) { count++; } } if (count > max_count) { max_count = count; most_common = argv[i]; } } printf("Most common argument is %s and it occurs %d times\n", most_common, max_count); return 0; }