#include
void main()
{
char string[81];
int i,j,num=0,word=0;
char b,c;
printf("Please input each word in lowercase letters.\n");
gets(string);
printf("The sentence lowercased is: ");
for(j=0;j<=strlen(string);j++)
if (string[j]>='A' && string[j]<='Z') string[j]=string[j]+32;
printf("\n",puts(string));
for (i=0;(c=string[i])!='\0';i++)
{
if(c==' ') word=0;
else if(word==0)
{
word=1;
num++;
}
}
printf("There are %d words in the line.\n",num);
}