Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- char word[100];
- printf("Insert word: ");
- scanf("%s", word);
- printf("The word is %s \n", word);
- char *p;
- int count = 0;
- int xCount = 0;
- for(p = word; *p; p++) {
- count++;
- if(*p == 'x') {
- xCount++;
- }
- }
- printf("You have %d letter in the word and x appears %d times", count, xCount);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement