Guest User

Untitled

a guest
Oct 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6. char word[100];
  7.  
  8. printf("Enter a sentence: ");
  9. scanf("%s", word);
  10.  
  11. char *tok = strtok(word, " ");
  12. printf("%sn", tok);
  13.  
  14. while(tok != NULL)
  15. {
  16. tok = strtok(NULL, " ");
  17. printf("%sn", tok);
  18.  
  19. if(tok == NULL)
  20. printf("finishedn");
  21. }
  22.  
  23. return 0;
  24. }
Add Comment
Please, Sign In to add comment