Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main ()
- {
- char string1[80];
- char string2[80];
- char string3[80];
- char *str1;
- char *str2;
- char *str3;
- char test;
- int count=0;
- printf("Enter a line of text: ");
- fgets(string1,80,stdin);
- printf("Enter a second line of text: ");
- fgets(string2,80,stdin);
- printf("Enter a final line of text: ");
- fgets(string3,80,stdin);
- str1=strchr(string1,'k');
- while(str1!=NULL)
- {
- count++;
- }
- printf("\nFound k %d times",count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement