write a function which will take a string and return the word count. each word is separete by space?
Answers
Answered by
1
int wordCount (char s[])
{
int count=0, i;
for (i=0;s[i]!='\0';i++)
{
if(s[i]==' ')
count++;
return count+1;
}
{
int count=0, i;
for (i=0;s[i]!='\0';i++)
{
if(s[i]==' ')
count++;
return count+1;
}
Similar questions
Social Sciences,
8 months ago
Computer Science,
8 months ago
Geography,
1 year ago
Physics,
1 year ago
Math,
1 year ago