void main()
{
char c[1000];
int i=0,j,co=0;
clrscr();
printf("enter the string");
gets(c);
while(c[i] != '\0' )
{
if(c[i] == " ") co++;
i++;}
printf("the string has %d words",co);
}
