Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5. int i,c=0;
  6. char str[100];
  7. getchar();
  8. gets(str);
  9. for(i=0;str[i]!='\0';i++)
  10. {
  11. if(str[i] ==' ')
  12. {
  13. c++;
  14. }
  15. }
  16. printf("Total space %d\n",c);
  17.  
  18. return 0;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement