Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- char a[100];
- int space=0, i;
- printf("Write a sentence: \n");
- gets(a);
- for(i=0; a[i]!='\0'; i++)
- {
- if( a[i]==' ' )
- {
- space+=1;
- }
- }
- printf("The number of spaces in the sentence are : %d",space);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement