Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. char s[50];
  5. printf("Enter any Sentence:");
  6. gets(s);
  7. int i=0,len=0,len2,word=0;
  8. while(s[i]!='\0')
  9. {
  10. len++;
  11. if(s[i]==' ')
  12. {
  13. word++;
  14. }
  15. i++;
  16. }
  17.  
  18. printf("\nTotal blank spaces : %d\n",word);
  19. len2=len-word;
  20. printf("Sentence length is %d",len2);
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement