Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- char s[50];
- printf("Enter any Sentence:");
- gets(s);
- int i=0,len=0,len2,word=0;
- while(s[i]!='\0')
- {
- len++;
- if(s[i]==' ')
- {
- word++;
- }
- i++;
- }
- printf("\nTotal blank spaces : %d\n",word);
- len2=len-word;
- printf("Sentence length is %d",len2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement