I have write this program but have an unexpected output. Can anyone help me to find what is the problem and modify it? I need to input text file in this program too.
Code:while(fgets(str,300,infp)!=NULL) { puts(str); } printf("What expressions do you want to find? Please enter here: \n"); gets(ex_str); if(strncmp(ex_str,str,strlen(ex_str))==0); count2++; printf("Total no of that expression appears %d times\n",count2);