Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- char word[100];
- printf("Enter a sentence: ");
- scanf("%s", word);
- char *tok = strtok(word, " ");
- printf("%sn", tok);
- while(tok != NULL)
- {
- tok = strtok(NULL, " ");
- printf("%sn", tok);
- if(tok == NULL)
- printf("finishedn");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment