#include #include typedef struct tokfq freq; struct tokfq{ char *token; int frequency; }; void frequency(char *tokens[],freq fq[]){ int i=0,j=0,n=0; while (tokens[i]!=NULL){ for(j=0;j=n){ fq[n].token=tokens[i]; fq[n].frequency=1; n++; } i++; } printf("Frequencies: "); for (i=0;i0){ if(fq[i].frequency>fmax){ fmax=fq[i].frequency; max_n=i; } i++; } printf("\nThe word with the max freq:%s\n",fq[max_n].token); } void read(char buf[]){ printf("Enter a sentence\n"); fgets(buf,50,stdin); buf[strlen(buf)-1]=0; printf("You entered %s\n",buf); } void main(){ char buf[50]; char *tokens[50]; freq fq[30]; read(buf); tokenize(buf,tokens); frequency(tokens,fq); max_fq(fq); }