Expand|Select|Wrap|Line Numbers
- # include<stdio.h>
- # include<math.h>
- # include<stdlib.h>
- # include<string.h>
- int main(void)
- {
- char s1[200], s2[200];
- char count;
- int count2;
- int run;
- int i;
- int j;
- int strstrcnt(const char *s1,const char *s2);
- char s[200];
- printf("\nThis is a program to find certian occurances of words in a user inputed sentence\n");
- printf("\nIt will display the number of times the word is found.\n");
- printf("\nTo run this program and input the word to find and the sentence to search hit 1,\n\n Hit 2 to exit.\n");
- scanf("%d",&run);
- fflush(stdin);
- while (run==1)
- {printf("\nPlease input the sentence you wish to hae searched.\n");
- gets(s1);
- printf("\nPlease enter the word or term you wish to have found in the sentence.\n");
- gets(s2);
- strstrcnt(s1,s2);
- printf("%d",s1[0]);
- }
- return(0);}
- int strstrcnt(const char *s1,const char *s2)
- {
- char * strstr(const char *s1, const char *s2);
- return (0);}