#include void main() { int i,count=0; char str[30]; clrscr(); printf("Enter Few words: "); gets(str); for(i=0;str[i]!='\0';i++) { if(str[i]==' ') count++; } printf("%s \n\nThe number of words in the above string is %d",str,count+1); getch(); }