//Count number of words.
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
void main()
{
clrscr();
char s[100];
int len,i,space,letter;
gets(s);
len=strlen(s);
for(i=0; i<=len; i++)
{
if(s==0)
space++;
else
letter++;
}
cout<<"Number of words= "<<space+1<<endl;
cout<<"Number of letters = "<<letter<<endl;
getch();
}
What's wrong with the prog ???? :S