//To Read and Display the word
//To Count Number Characters, words, Lines Until $
#include<stdio.h>
main()
{
	int i,l=0,w=0,c=0;
	char a[100];
	clrscr();
	printf("enter the input\n");
	i=0;
	scanf("%c",&a[i]);
	while(a[i]!='$')
	{
		i++;
		scanf("%c",&a[i]);
	}
	printf("output\n");
	a[i]='\0';
	i=0;
	while(a[i]!='\0')
	{
		if ((a[i]!=' ' && a[i+1]==' ') || (a[i]!='\t' && a[i+1]=='\t') || (a[i]!='\n' && a[i+1]=='\n'))
			w++;
		if(a[i]=='\n')
			l++;
		c++;
		i++;
	}
	printf("The Number of Characters=%d\n",c);
	printf("The Number of Words     =%d\n",w);
	printf("The Number of Lines     =%d\n",l);

	getch();
}