i need some help to figure out how to find the most frequent entry that was inputed
Code:#include <stdio.h> #include <math.h> #define MAXARR 100 void main (void) { int mode[MAXARR], i, entry; int counter = 0; int total = 0; int total2 = 0; int mostfreq = 0; float average, stdev; printf("Please type your entry (-1 to quit): \n"); scanf("%d",&entry); while (entry >= 0) { total = total + entry; total2 = total2 + entry * entry; mode[entry]++; counter = counter +1; printf("Please type your entry (-1 to quit): \n"); scanf("%d",&entry); } average = (float)total / (float)counter; for(i=0;i<100;i++) { if (mode[i] > mostfreq); { mostfreq = mode[i]; } } printf("Most common age is %d \n", i); printf("It occurs %d times \n", mostfreq); printf("There are %d ages recorded \n", counter); stdev = sqrt (total2 / counter - average * average); printf("The average age is : %6.2f \n", average); printf("The standard deviation from the average is %6.2f \n", stdev); getchar(); getchar(); }