#include"stdio.h"
void main()
{
char str[200]="I love you my honey";
int i;
int word=0;
int num=0;
for(i=0;i<200;i++)
{
if(str[i]==' ')
{
word=1;
}
else
if(word==1)
{
word=0;
num++;
}
}
printf("There are %d words",num)
}
#include"stdio.h"
void main()
{
char str[200]="I love you my honey";
int i;
int word=0;
int num=0;
for(i=0;i<200;i++)
{
if(str[i]==' ')
{
word=1;
}
else
if(word==1)
{
word=0;
num++;
}
}
printf("There are %d words",num)
}