C++ program to find number of words in a sentence.
main ()
{
char line [81], ch;
int c = 0;
cout << "Enter text of input and Press enter key";
ch = getchar ();
while (ch! = \n')
{
line [c] = ch;
ch = getchar ();
c++
}
line[c] = '\0';
for (int i=0; line [i] != '\0'; i++)
{
if (line [i] == " \\ line [i] == '\t'
{
words++;
}
}
cout << "no of words:" << words;
}
