-
-
Save anonymous/170a01ff2c1a7ee593ee0d345bbb2104 to your computer and use it in GitHub Desktop.
programmingfaster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
#include<string.h> | |
int main() | |
{ | |
int i, wordcount=1; | |
char str[100]; | |
printf("Enter a sentence:"); | |
gets(str); | |
for(i=0;i<strlen(str);i++) | |
{ | |
if(str[i]==32) | |
{ | |
wordcount++; | |
} | |
} | |
printf("The number of words=%d",wordcount); | |
getch(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment