Skip to content

Instantly share code, notes, and snippets.

/programmingfaster Secret

Created Feb 16, 2018
Embed
What would you like to do?
programmingfaster
#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
You can’t perform that action at this time.