/* To Read a text Until $ and search the given text exist or not*/
#include<stdio.h>
main()
{
	int i,j,k,w;
	char a[150],b[100];
	clrscr();
	printf("Enter the input\n");
	for(i=0;(a[i]=getchar())!='$';i++);
	a[i]='\0';
	printf("Enter the search tex\n");
	for(j=0;(b[j]=getchar())!='$';j++);
	b[j]='\0';
	w=0;
	for(i=0;a[i];i++)
	{
	  for(j=0,k=i;(b[j]==a[k]) && (b[j]!='\0');j++,k++);

	    if (b[j]=='\0')
	    {
	       printf("The Searchable text exist");
	       w++;
	    }

	}
	if (w==0)
	printf ("Searchable text does not exist");
	getch();
}

/* Exercise: 1. To read a text from KB until $ and print N-th line to M-th line