#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
char str[80];
int count=01;
cout<<”Enter a string”;
cin>>str;
int len=strlen(str);
for(int i=0;i<len;i++)
{
if(str*i+==’ ‘)
{
count++;
}
}
cout<<”\n the no of words in a given line is “<<count<<endl;
getch();
}