#include #include #include int main(void) { char *string[] = { "apple", "orange", "banana", }; FILE *fptr; fptr=fopen("abc.txt","r"); int cnt=0, n; char word[100]; while (fscanf(fptr, "%100s", word) != EOF) { size_t n; for (n = 0; n < sizeof string / sizeof *string; ++n) { if (strcasecmp(word, string[n]) == 0) ++cnt; } } printf("No. of word found: %d",cnt); getchar(); }